From abf21c7f3f0a10143cb0c81d7f1c6ace12da3007 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 26 Nov 2006 18:55:29 +0000 Subject: Fix to work with channel notices. SILENCE_PRIVATE silences private PRIVMSG, SILENCE_NOTICE silences private NOTICE, and SILENCE_CHANNEL silences channel PRIVMSG *and* channel NOTICE. This makes sense to me... :) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5809 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_silence_ext.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modules/m_silence_ext.cpp b/src/modules/m_silence_ext.cpp index 142a19e15..a9878f963 100644 --- a/src/modules/m_silence_ext.cpp +++ b/src/modules/m_silence_ext.cpp @@ -270,11 +270,12 @@ class ModuleSilence : public Module output = output + " ESILENCE SILENCE=999"; } - virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) + + virtual int PreText(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list, int silence_type) { if (target_type == TYPE_USER) { - return MatchPattern((userrec*)dest, user, SILENCE_PRIVATE); + return MatchPattern((userrec*)dest, user, silence_type); } else if (target_type == TYPE_CHANNEL) { @@ -313,9 +314,14 @@ class ModuleSilence : public Module return 0; } + virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) + { + return PreText(user, dest, target_type, text, status, exempt_list, SILENCE_PRIVATE); + } + virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list) { - return MatchPattern((userrec*)dest, user, SILENCE_NOTICE); + return PreText(user, dest, target_type, text, status, exempt_list, SILENCE_NOTICE); } virtual int OnUserPreInvite(userrec* source,userrec* dest,chanrec* channel) -- cgit v1.2.3