]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ojoin.cpp
Increase penalty for KNOCK
[user/henk/code/inspircd.git] / src / modules / m_ojoin.cpp
index 122e1fa30dc5cbacaedc0fd88512b231d723670d..6e9e3681200304f4ee14384765727e9999931261 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
@@ -83,8 +83,7 @@ class CommandOjoin : public Command
                        modes.push_back(parameters[0]);
                        modes.push_back("+Y");
                        modes.push_back(user->nick);
-                       ServerInstance->SendMode(modes, ServerInstance->FakeClient);
-                       ServerInstance->PI->SendMode(parameters[0], ServerInstance->Modes->GetLastParseParams(), ServerInstance->Modes->GetLastParseTranslate());
+                       ServerInstance->SendGlobalMode(modes, ServerInstance->FakeClient);
                }
                return CMD_SUCCESS;
        }
@@ -211,6 +210,10 @@ class ModuleOjoin : public Module
 
        ModuleOjoin()
                : np(NULL), mycommand(this)
+       {
+       }
+
+       void init()
        {
                /* Load config stuff */
                OnRehash(NULL);
@@ -218,13 +221,8 @@ 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_OnUserPreKick, I_OnRehash };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -290,7 +288,7 @@ class ModuleOjoin : public Module
 
        Version GetVersion()
        {
-               return Version("Network Buisness Join", VF_COMMON | VF_VENDOR);
+               return Version("Network Buisness Join", VF_VENDOR);
        }
 };