]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_helpop.cpp
Run DelMode and DelModeWatcher in RemoveModule
[user/henk/code/inspircd.git] / src / modules / m_helpop.cpp
index 4800ebac8328bc327e349bcf673f8a408114471e..c1b669d3f5651ae23fd437cba60bf0608d205089 100644 (file)
@@ -22,9 +22,12 @@ static std::map<irc::string, std::string> helpop_map;
 class Helpop : public ModeHandler
 {
  public:
-       Helpop(InspIRCd* Instance) : ModeHandler(Instance, 'h', 0, 0, false, MODETYPE_USER, true) { }
+       Helpop(Module* Creator) : ModeHandler(Creator, 'h', PARAM_NONE, MODETYPE_USER)
+       {
+               oper = true;
+       }
 
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
        {
                if (adding)
                {
@@ -52,9 +55,8 @@ class Helpop : public ModeHandler
 class CommandHelpop : public Command
 {
  public:
-       CommandHelpop (InspIRCd* Instance) : Command(Instance, "HELPOP", 0, 0)
+       CommandHelpop(Module* Creator) : Command(Creator, "HELPOP", 0)
        {
-               this->source = "m_helpop.so";
                syntax = "<any-text>";
        }
 
@@ -118,8 +120,8 @@ class ModuleHelpop : public Module
                Helpop ho;
 
        public:
-               ModuleHelpop(InspIRCd* Me)
-                       : Module(Me), cmd(Me), ho(Me)
+               ModuleHelpop()
+                       : cmd(this), ho(this)
                {
                        ReadConfig();
                        if (!ServerInstance->Modes->AddMode(&ho))
@@ -131,7 +133,7 @@ class ModuleHelpop : public Module
 
                virtual void ReadConfig()
                {
-                       ConfigReader MyConf(ServerInstance);
+                       ConfigReader MyConf;
 
                        helpop_map.clear();
 
@@ -177,12 +179,11 @@ class ModuleHelpop : public Module
 
                virtual ~ModuleHelpop()
                {
-                       ServerInstance->Modes->DelMode(&ho);
                }
 
                virtual Version GetVersion()
                {
-                       return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+                       return Version("/helpop Command, Works like Unreal helpop", VF_COMMON | VF_VENDOR, API_VERSION);
                }
 };