]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_stripcolor.cpp
Instead of re adding the HandshakeTimer in m_spanningtree, make it a reoccurring...
[user/henk/code/inspircd.git] / src / modules / m_stripcolor.cpp
index 9fec3dcad9ad634271780bd1764581407e35d1ee..19f658ee0f628bf05b0880c44c9267cf73089756 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -46,11 +46,10 @@ class ModuleStripColor : public Module
 
                if (!ServerInstance->Modes->AddMode(usc) || !ServerInstance->Modes->AddMode(csc))
                        throw ModuleException("Could not add new modes!");
-               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
+               ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
-
        virtual ~ModuleStripColor()
        {
                ServerInstance->Modes->DelMode(usc);
@@ -59,6 +58,11 @@ class ModuleStripColor : public Module
                delete csc;
        }
 
+       virtual void On005Numeric(std::string &output)
+       {
+               ServerInstance->AddExtBanChar('S');
+       }
+
        virtual void ReplaceLine(std::string &sentence)
        {
                /* refactor this completely due to SQUIT bug since the old code would strip last char and replace with \0 --peavey */
@@ -68,7 +72,7 @@ class ModuleStripColor : public Module
                {
                        if ((*i == 3))
                                seq = 1;
-                       else if (seq && ( (*i >= '0') && (*i <= '9') || (*i == ',') ) )
+                       else if (seq && (( ((*i >= '0') && (*i <= '9')) || (*i == ',') ) ))
                        {
                                seq++;
                                if ( (seq <= 4) && (*i == ',') )
@@ -121,7 +125,7 @@ class ModuleStripColor : public Module
                                return 0;
                        }
 
-                       active = t->IsModeSet('S');
+                       active = t->IsModeSet('S') || t->GetExtBanStatus(user, 'S') < 0;
                }
 
                if (active)
@@ -139,7 +143,7 @@ class ModuleStripColor : public Module
 
        virtual Version GetVersion()
        {
-               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
        }
 
 };