summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-26 18:55:29 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-11-26 18:55:29 +0000
commitabf21c7f3f0a10143cb0c81d7f1c6ace12da3007 (patch)
tree2cc8c0c86dce1b2202011921d92ef6a2bc954903 /src/modules
parent119dcd1c83a5b5b425d7a723970e37fdb13c9760 (diff)
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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_silence_ext.cpp12
1 files changed, 9 insertions, 3 deletions
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)