From 235a0a2035bda6dd214719107083266207f39883 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 4 Feb 2006 13:09:18 +0000 Subject: Added "char status" parameter to OnUserPreNotice and OnUserPreMessage for NOTICE @#chan etc. Tidied up craq++ in modules (copy and pasting OnUserPreNotice into OnUserPreMessage?! why not just call one from the other!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3072 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_silence.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'src/modules/m_silence.cpp') diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index a0207344c..e785265ac 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -164,7 +164,7 @@ class ModuleSilence : public Module output = output + " SILENCE=999"; } - virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text) + virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text, char status) { // im not sure how unreal's silence operates but ours is sensible. It blocks notices and // privmsgs from people on the silence list, directed privately at the user. @@ -190,26 +190,9 @@ class ModuleSilence : public Module return 0; } - virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text) + virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status) { - if (target_type == TYPE_USER) - { - userrec* u = (userrec*)dest; - silencelist* sl = (silencelist*)u->GetExt("silence_list"); - if (sl) - { - for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++) - { - irc::string listitem = c->c_str(); - irc::string target = user->nick; - if (listitem == target) - { - return 1; - } - } - } - } - return 0; + return OnUserPreNotice(user,dest,target_type,text,status); } virtual ~ModuleSilence() -- cgit v1.2.3