]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hideoper.cpp
Include explicit routing information in Command, will replace CMD_LOCALONLY return...
[user/henk/code/inspircd.git] / src / modules / m_hideoper.cpp
index 50281f69ba88988bbe899593f6b08edf900a5520..c204d51e9952a4d9db3d6c0efce821f57301e091 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -47,15 +47,13 @@ class HideOper : public ModeHandler
 
 class ModuleHideOper : public Module
 {
-
-       HideOper* hm;
+       HideOper hm;
  public:
        ModuleHideOper(InspIRCd* Me)
-               : Module(Me)
+               : Module(Me), hm(Me)
        {
 
-               hm = new HideOper(ServerInstance);
-               if (!ServerInstance->Modes->AddMode(hm))
+               if (!ServerInstance->Modes->AddMode(&hm))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnWhoisLine };
                ServerInstance->Modules->Attach(eventlist, this, 1);
@@ -64,8 +62,7 @@ class ModuleHideOper : public Module
 
        virtual ~ModuleHideOper()
        {
-               ServerInstance->Modes->DelMode(hm);
-               delete hm;
+               ServerInstance->Modes->DelMode(&hm);
        }
 
        virtual Version GetVersion()
@@ -84,7 +81,7 @@ class ModuleHideOper : public Module
                if (!dest->IsModeSet('H'))
                        return 0;
 
-               if (user->HasPrivPermission("users/auspex"))
+               if (!user->HasPrivPermission("users/auspex"))
                        return 1;
 
                return 0;