Only send NOTICEs after 001 (authenticated)
authorKyle Fuller <redacted>
Tue, 5 Jul 2016 19:50:10 +0000 (20:50 +0100)
committerKyle Fuller <redacted>
Tue, 5 Jul 2016 19:50:10 +0000 (20:50 +0100)
palaver.cpp

index 8ffdd33e978a732fd7783adb00cf76bbd80a9e50..05dd5c85a8d3aff897daef3dfe0e625759b2e6a5 100644 (file)
@@ -18,6 +18,7 @@
 #include <znc/Client.h>
 #include <znc/Chan.h>
 #include <znc/FileUtils.h>
+#include <znc/IRCSock.h>
 
 #if defined VERSION_MAJOR && defined VERSION_MINOR && VERSION_MAJOR >= 1 && VERSION_MINOR >= 5
 #define HAS_REGEX
@@ -1081,7 +1082,16 @@ public:
        }
 
        virtual EModRet OnPrivNotice(CNick& Nick, CString& sMessage) {
-               ParseMessage(Nick, sMessage, NULL);
+               const auto network = GetNetwork();
+
+               if (network) {
+                       const auto sock = network->GetIRCSock();
+
+                       if (sock && sock->IsAuthed()) {
+                               ParseMessage(Nick, sMessage, NULL);
+                       }
+               }
+
                return CONTINUE;
        }
 
git clone https://git.99rst.org/PROJECT