]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ojoin.cpp
Fix iteration of oper blocks by SSLINFO
[user/henk/code/inspircd.git] / src / modules / m_ojoin.cpp
index 775dea204d3fc78f6e740b0bcaee3b372cf87c37..176a0e613e648259b9ea960080e7bf562a4d12b6 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -211,6 +211,10 @@ class ModuleOjoin : public Module
 
        ModuleOjoin()
                : np(NULL), mycommand(this)
+       {
+       }
+
+       void init()
        {
                /* Load config stuff */
                OnRehash(NULL);
@@ -218,16 +222,11 @@ class ModuleOjoin : public Module
                /* Initialise module variables */
                np = new NetworkPrefix(this);
 
-               if (!ServerInstance->Modes->AddMode(np))
-               {
-                       delete np;
-                       throw ModuleException("Could not add new mode!");
-               }
-
-               ServerInstance->AddCommand(&mycommand);
+               ServerInstance->Modules->AddService(*np);
+               ServerInstance->Modules->AddService(mycommand);
 
-               Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserKick, I_OnUserPart, I_OnUserPreKick, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, this, 5);
+               Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserPreKick, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
        ModResult OnUserPreJoin(User *user, Channel *chan, const char *cname, std::string &privs, const std::string &keygiven)
@@ -290,7 +289,7 @@ class ModuleOjoin : public Module
 
        Version GetVersion()
        {
-               return Version("Network Buisness Join", VF_COMMON | VF_VENDOR);
+               return Version("Network Buisness Join", VF_VENDOR);
        }
 };