]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_servprotect.cpp
Extra debug
[user/henk/code/inspircd.git] / src / modules / m_servprotect.cpp
index 902a4d37649913bdfa2ae14dc5e80ccb6631a378..1dbb9384fc3ae7a427080cfea37f1f5445efce21 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,7 +46,7 @@ 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);
@@ -61,7 +61,7 @@ class ModuleServProtectMode : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_COMMON,API_VERSION);
+               return Version(1,2,0,0,VF_COMMON,API_VERSION);
        }
 
        virtual void OnWhois(User* src, User* dst)
@@ -79,8 +79,8 @@ 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+")");
+                       src->WriteNumeric(485, "%s :You are not allowed to kill %s Services!", src->nick, ServerInstance->Config->Network);
+                       ServerInstance->SNO->WriteToSnoMask('A', std::string(src->nick)+" tried to kill service "+dst->nick+" ("+reason+")");
                        return 1;
                }
                return 0;