]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_services.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / modules / m_services.cpp
index 88a6b8fb91b22c44afaab769ddea98801ddd144f..0c700da8f193191932a2483180bd62e760daa9b1 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -179,13 +179,15 @@ class ModuleServices : public Module
                m4 = new User_r(ServerInstance);
                m5 = new User_R(ServerInstance);
 
-               if (!ServerInstance->AddMode(m1, 'r') || !ServerInstance->AddMode(m2, 'R') || !ServerInstance->AddMode(m3, 'M')
-                       || !ServerInstance->AddMode(m4, 'r') || !ServerInstance->AddMode(m5, 'R'))
+               if (!ServerInstance->Modes->AddMode(m1) || !ServerInstance->Modes->AddMode(m2) || !ServerInstance->Modes->AddMode(m3)
+                       || !ServerInstance->Modes->AddMode(m4) || !ServerInstance->Modes->AddMode(m5))
                {
                        throw ModuleException("Could not add user and channel modes!");
                }
        
                kludgeme = false;
+               Implementation eventlist[] = { I_OnWhois, I_OnUserPostNick, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreJoin };
+               ServerInstance->Modules->Attach(eventlist, this, 5);
        }
 
        /* <- :stitch.chatspike.net 307 w00t w00t :is a registered nick */
@@ -198,10 +200,6 @@ class ModuleServices : public Module
                }
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnWhois] = List[I_OnUserPostNick] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = List[I_OnUserPreJoin] = 1;
-       }
 
        virtual void OnUserPostNick(User* user, const std::string &oldnick)
        {