]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hideoper.cpp
This will royally fuck 1.2's linking right now, but..
[user/henk/code/inspircd.git] / src / modules / m_hideoper.cpp
index 0785fd185442327be83097b7f5dbb9e0096fd373..9f547d77db0a6e22ca8a23dbe6f1760bbcc7c2d5 100644 (file)
  * ---------------------------------------------------
  */
 
+#include "inspircd.h"
 #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 +23,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 +57,7 @@ class ModuleHideOper : public Module
        HideOper* hm;
  public:
        ModuleHideOper(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                hm = new HideOper(ServerInstance);
@@ -86,30 +86,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'));
-       }
-};
-
-class ModuleHideOperFactory : public ModuleFactory
-{
- public:
-       ModuleHideOperFactory()
-       {
+               return ((!IS_OPER(user)) && (numeric == 313) && dest->IsModeSet('H'));
        }
-       
-       ~ModuleHideOperFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleHideOper(Me);
-       }
-       
 };
 
 
-extern "C" void * init_module( void )
-{
-       return new ModuleHideOperFactory;
-}
+MODULE_INIT(ModuleHideOper)