]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hideoper.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_hideoper.cpp
index 0785fd185442327be83097b7f5dbb9e0096fd373..1e4f7ae85009d75f87c90b386785663fdb2fef0c 100644 (file)
@@ -11,9 +11,6 @@
  * ---------------------------------------------------
  */
 
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for hiding oper status with user mode +H */
@@ -23,7 +20,7 @@
 class HideOper : public ModeHandler
 {
  public:
-       HideOper(InspIRCd* Instance) : ModeHandler(Instance, 'H', 0, 'o', false, MODETYPE_USER, true) { }
+       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)
        {
@@ -57,7 +54,7 @@ class ModuleHideOper : public Module
        HideOper* hm;
  public:
        ModuleHideOper(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                hm = new HideOper(ServerInstance);
@@ -86,30 +83,9 @@ class ModuleHideOper : public Module
                /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the
                 * person doing the WHOIS is not an oper
                 */
-               return ((!*user->oper) && (numeric == 313) && dest->IsModeSet('H'));
+               return ((!IS_OPER(user)) && (numeric == 313) && dest->IsModeSet('H'));
        }
 };
 
-class ModuleHideOperFactory : public ModuleFactory
-{
- public:
-       ModuleHideOperFactory()
-       {
-       }
-       
-       ~ModuleHideOperFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleHideOper(Me);
-       }
-       
-};
-
 
-extern "C" void * init_module( void )
-{
-       return new ModuleHideOperFactory;
-}
+MODULE_INIT(ModuleHideOper)