]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence_ext.cpp
Add config <options:disablehmac> to support disabling of HMAC, and tidy up to detect...
[user/henk/code/inspircd.git] / src / modules / m_silence_ext.cpp
index 12727bc86b3c3026a91ceaf81e0f9b4d16a2d0ef..ba76abc294dc7f7623ad118822925e04a041debf 100644 (file)
@@ -253,7 +253,7 @@ class ModuleSilence : public Module
                List[I_OnBuildExemptList] = List[I_OnUserQuit] = List[I_On005Numeric] = List[I_OnUserPreNotice] = List[I_OnUserPreMessage] = List[I_OnUserPreInvite] = 1;
        }
 
-       virtual void OnUserQuit(userrec* user, const std::string &reason)
+       virtual void OnUserQuit(userrec* user, const std::string &reason, const std::string &oper_message)
        {
                // when the user quits tidy up any silence list they might have just to keep things tidy
                silencelist* sl;
@@ -305,6 +305,9 @@ class ModuleSilence : public Module
 
        virtual int PreText(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list, int silence_type)
        {
+               if (!IS_LOCAL(user))
+                       return 0;
+
                if (target_type == TYPE_USER)
                {
                        return MatchPattern((userrec*)dest, user, silence_type);
@@ -343,16 +346,8 @@ class ModuleSilence : public Module
                {
                        for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
                        {
-                               if ((match(source->GetFullHost(), c->first.c_str())) && ( ((c->second & pattern) > 0)) || ((c->second & SILENCE_ALL) > 0))
-                               {
-                                       if (((c->second & SILENCE_EXCLUDE) > 0))
-                                       {
-                                               return 0;
-                                       }
-                                       else {
-                                               return 1;
-                                       }
-                               }
+                               if (((((c->second & pattern) > 0)) || ((c->second & SILENCE_ALL) > 0)) && (ServerInstance->MatchText(source->GetFullHost(), c->first)))
+                                       return !(((c->second & SILENCE_EXCLUDE) > 0));
                        }
                }
                return 0;