]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_stripcolor.cpp
m_override now has a 'requirekey' option, that requires a special key of 'override...
[user/henk/code/inspircd.git] / src / modules / m_stripcolor.cpp
index 17c0a2f300dd41caff7314b55761e54283f5672a..9b3f8c2f1d70011a155199ecaa30b1161aa614d4 100644 (file)
@@ -129,10 +129,17 @@ class ModuleStripColor : public Module
                        
                        if (seq || ((*i == 2) || (*i == 15) || (*i == 22) || (*i == 21) || (*i == 31)))
                        {
-                               safei = i;
-                               --i;
-                               sentence.erase(safei);
-                       }
+                               if (i != sentence.begin())
+                               {
+                                       safei = i;
+                                       --i;
+                                       sentence.erase(safei);
+                               }
+                               else
+                               {
+                                       sentence.erase(i);
+                                       i = sentence.begin();
+                               }                       }
                }
        }
 
@@ -153,8 +160,12 @@ class ModuleStripColor : public Module
 
                        // check if we allow ops to bypass filtering, if we do, check if they're opped accordingly.
                        // note: short circut logic here, don't wreck it. -- w00t
-                       if (!CHANOPS_EXEMPT(ServerInstance, 'S') || CHANOPS_EXEMPT(ServerInstance, 'S') && t->GetStatus(user) != STATUS_OP)
-                               active = t->IsModeSet('S');
+                       if (CHANOPS_EXEMPT(ServerInstance, 'S') && t->GetStatus(user) == STATUS_OP)
+                       {
+                               return 0;
+                       }
+
+                       active = t->IsModeSet('S');
                }
 
                if (active)
@@ -172,7 +183,7 @@ class ModuleStripColor : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
        }
        
 };