]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hideoper.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / modules / m_hideoper.cpp
index 1e4f7ae85009d75f87c90b386785663fdb2fef0c..024af222145d486f1de1e74c23e0163f7550ece5 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
@@ -22,7 +22,7 @@ class HideOper : public ModeHandler
  public:
        HideOper(InspIRCd* Instance) : ModeHandler(Instance, 'H', 0, 0, false, MODETYPE_USER, true) { }
 
-       ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
                if (source != dest)
                        return MODEACTION_DENY;
@@ -58,19 +58,17 @@ class ModuleHideOper : public Module
        {
                
                hm = new HideOper(ServerInstance);
-               if (!ServerInstance->AddMode(hm, 'H'))
+               if (!ServerInstance->Modes->AddMode(hm))
                        throw ModuleException("Could not add new modes!");
+               Implementation eventlist[] = { I_OnWhoisLine };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnWhoisLine] = 1;
-       }
        
        virtual ~ModuleHideOper()
        {
                ServerInstance->Modes->DelMode(hm);
-               DELETE(hm);
+               delete hm;
        }
        
        virtual Version GetVersion()
@@ -78,7 +76,7 @@ class ModuleHideOper : public Module
                return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 
-       int OnWhoisLine(userrec* user, userrec* dest, int &numeric, std::string &text)
+       int OnWhoisLine(User* user, User* dest, int &numeric, std::string &text)
        {
                /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the
                 * person doing the WHOIS is not an oper