]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_servprotect.cpp
m_namedmodes Only show chan key to members and opers with channels/auspex
[user/henk/code/inspircd.git] / src / modules / m_servprotect.cpp
index c98eebec36ecd04975fe682b74408585e7f05778..b4f2b5bbd5ae5ba5a42ac78a9db2587e8a7c4ec9 100644 (file)
@@ -51,10 +51,13 @@ class ModuleServProtectMode : public Module
        ModuleServProtectMode()
                : bm(this)
        {
-               if (!ServerInstance->Modes->AddMode(&bm))
-                       throw ModuleException("Could not add new modes!");
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(bm);
                Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine, I_OnRawMode, I_OnUserPreKick };
-               ServerInstance->Modules->Attach(eventlist, this, 5);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
 
@@ -71,7 +74,7 @@ class ModuleServProtectMode : public Module
        {
                if (dst->IsModeSet('k'))
                {
-                       ServerInstance->SendWhoisLine(src, dst, 310, std::string(src->nick)+" "+std::string(dst->nick)+" :is an "+ServerInstance->Config->Network+" Service");
+                       ServerInstance->SendWhoisLine(src, dst, 310, src->nick+" "+dst->nick+" :is an "+ServerInstance->Config->Network+" Service");
                }
        }
 
@@ -112,7 +115,7 @@ class ModuleServProtectMode : public Module
                if (dst->IsModeSet('k'))
                {
                        src->WriteNumeric(485, "%s :You are not permitted to kill %s services!", src->nick.c_str(), ServerInstance->Config->Network.c_str());
-                       ServerInstance->SNO->WriteGlobalSno('a', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")");
+                       ServerInstance->SNO->WriteGlobalSno('a', src->nick+" tried to kill service "+dst->nick+" ("+reason+")");
                        return MOD_RES_DENY;
                }
                return MOD_RES_PASSTHRU;