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_blockcolor.cpp | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) (limited to 'src/modules/m_blockcolor.cpp') diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 461a05de4..c53520adb 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -47,7 +47,7 @@ class ModuleBlockColor : public Module InsertMode(output,"c",4); } - 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_CHANNEL) { @@ -80,37 +80,9 @@ class ModuleBlockColor : public Module return 0; } - 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) { - if (target_type == TYPE_CHANNEL) - { - chanrec* c = (chanrec*)dest; - char ctext[MAXBUF]; - char *ctptr = ctext; - strlcpy(ctext,text.c_str(),MAXBUF); - - - if (c->IsCustomModeSet('c')) - { - /* Instead of using strchr() here, do our own loop. Hopefully faster. --w00t */ - while (ctptr && *ctptr) - { - switch (*ctptr++) - { - case 2: - case 3: - case 15: - case 21: - case 22: - case 31: - WriteServ(user->fd,"404 %s %s :Can't send colors to channel (+c set)",user->nick, c->name); - return 1; - break; - } - } - } - } - return 0; + return OnUserPreMessage(user,dest,target_type,text,status); } virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) -- cgit v1.2.3