]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_servprotect.cpp
YAY for LDAP oper blocks! :D
[user/henk/code/inspircd.git] / src / modules / m_servprotect.cpp
index a33b05c385bce660465ad18be343ad2d0515070e..e0ea6911c3cc258873953017e842e5bfc03a713b 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
@@ -28,7 +28,7 @@ class ServProtectMode : public ModeHandler
  public:
        ServProtectMode(InspIRCd* Instance) : ModeHandler(Instance, 'k', 0, 0, false, MODETYPE_USER, true) { }
 
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                return MODEACTION_DENY;
        }
@@ -46,21 +46,17 @@ class ModuleServProtectMode : public Module
        {
                
                bm = new ServProtectMode(ServerInstance);
-               if (!ServerInstance->AddMode(bm))
+               if (!ServerInstance->Modes->AddMode(bm))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnWhois, I_OnKill, I_OnWhoisLine };
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnWhois] = List[I_OnKill] = List[I_OnWhoisLine] = 1;
-       }
        
        virtual ~ModuleServProtectMode()
        {
                ServerInstance->Modes->DelMode(bm);
-               DELETE(bm);
+               delete bm;
        }
        
        virtual Version GetVersion()
@@ -84,7 +80,7 @@ class ModuleServProtectMode : public Module
                if (dst->IsModeSet('k'))
                {
                        src->WriteServ("485 %s :You are not allowed to kill %s Services!", src->nick, ServerInstance->Config->Network);
-                       ServerInstance->WriteOpers("*** "+std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")");
+                       ServerInstance->SNO->WriteToSnoMask('A', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")");
                        return 1;
                }
                return 0;