]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockcaps.cpp
Remove some debug (im on a crusade to make debug mode useful, but at the same time...
[user/henk/code/inspircd.git] / src / modules / m_blockcaps.cpp
index be366411eeb5df407aeeffc7b99a9a66df140fb8..058336fb37f1c3aeacbabb4a9b4ef2f3f1f3056c 100644 (file)
@@ -59,9 +59,10 @@ public:
        
        ModuleBlockCAPS(InspIRCd* Me) : Module::Module(Me)
        {
-               OnRehash("");
+               OnRehash(NULL,"");
                bc = new BlockCaps(ServerInstance);
-               ServerInstance->AddMode(bc, 'P');
+               if (!ServerInstance->AddMode(bc, 'P'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        void Implements(char* List)
@@ -69,7 +70,7 @@ public:
                List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnRehash] = 1;
        }
 
-       virtual void OnRehash(const std::string &param)
+       virtual void OnRehash(userrec* user, const std::string &param)
        {
                ReadConf();
        }
@@ -86,8 +87,7 @@ public:
                        if (c->IsModeSet('P'))
                        {
                                int caps = 0;
-                               const char* i = text.c_str();
-                               for (; *i; i++)
+                               for (std::string::iterator i = text.begin(); i != text.end(); i++)
                                {
                                        if ( (*i >= 'A') && (*i <= 'Z'))
                                                caps++;