]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_showwhois.cpp
- Tear out a useless load of XLine clutters that did nothing much except confuse...
[user/henk/code/inspircd.git] / src / modules / m_showwhois.cpp
index 2b83243c110499d2ca74d6df3decbc0949670b05..02a74535cf3fa6ef51c4a94c3f695033f19e36bf 100644 (file)
@@ -11,9 +11,6 @@
  * ---------------------------------------------------
  */
 
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* $ModDesc: Allows opers to set +W to see when a user uses WHOIS on them */
@@ -25,7 +22,7 @@ class SeeWhois : public ModeHandler
  public:
        SeeWhois(InspIRCd* Instance) : ModeHandler(Instance, 'W', 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)
        {
                /* Only opers can change other users modes */
                if (source != dest)
@@ -59,11 +56,11 @@ class ModuleShowwhois : public Module
 
  public:
 
-       ModuleShowwhois(InspIRCd* Me) : Module::Module(Me)
+       ModuleShowwhois(InspIRCd* Me) : Module(Me)
        {
                
                sw = new SeeWhois(ServerInstance);
-               if (!ServerInstance->AddMode(sw, 'W'))
+               if (!ServerInstance->AddMode(sw))
                        throw ModuleException("Could not add new modes!");
        }
 
@@ -83,7 +80,7 @@ class ModuleShowwhois : public Module
                return Version(1,1,0,3,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 
-       virtual void OnWhois(userrec* source, userrec* dest)
+       virtual void OnWhois(User* source, User* dest)
        {
                if ((dest->IsModeSet('W')) && (source != dest))
                {
@@ -106,25 +103,4 @@ class ModuleShowwhois : public Module
 
 };
 
-class ModuleShowwhoisFactory : public ModuleFactory
-{
-       public:
-               ModuleShowwhoisFactory()
-               {
-               }
-
-               ~ModuleShowwhoisFactory()
-               {
-               }
-
-               virtual Module* CreateModule(InspIRCd* Me)
-               {
-                       return new ModuleShowwhois(Me);
-               }
-
-};
-
-extern "C" void* init_module()
-{
-       return new ModuleShowwhoisFactory;
-}
+MODULE_INIT(ModuleShowwhois)