]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_helpop.cpp
Send HALFOP= line in CAPAB CAPABILITIES for 1201 compat (anope relies on this)
[user/henk/code/inspircd.git] / src / modules / m_helpop.cpp
index 6533aa5953529730e4c5765b6bc561335afea374..4c5dc23a99f339350e0937331e23e463169681f4 100644 (file)
 
 #include "inspircd.h"
 
-/* $ModDesc: /helpop Command, Works like Unreal helpop */
 static std::map<irc::string, std::string> helpop_map;
 
-
 /** Handles user mode +h
  */
 class Helpop : public ModeHandler
@@ -118,19 +116,20 @@ class ModuleHelpop : public Module
        public:
                ModuleHelpop()
                        : cmd(this), ho(this)
+               {
+               }
+
+               void init()
                {
                        ReadConfig();
-                       if (!ServerInstance->Modes->AddMode(&ho))
-                               throw ModuleException("Could not add new modes!");
-                       ServerInstance->AddCommand(&cmd);
+                       ServerInstance->Modules->AddService(ho);
+                       ServerInstance->Modules->AddService(cmd);
                        Implementation eventlist[] = { I_OnRehash, I_OnWhois };
                        ServerInstance->Modules->Attach(eventlist, this, 2);
                }
 
-               virtual void ReadConfig()
+               void ReadConfig()
                {
-                       ConfigReader MyConf;
-
                        helpop_map.clear();
 
                        ConfigTagList tags = ServerInstance->Config->ConfTags("helpop");
@@ -162,13 +161,12 @@ class ModuleHelpop : public Module
 
                }
 
-
-               virtual void OnRehash(User* user)
+               void OnRehash(User* user)
                {
                        ReadConfig();
                }
 
-               virtual void OnWhois(User* src, User* dst)
+               void OnWhois(User* src, User* dst)
                {
                        if (dst->IsModeSet('h'))
                        {
@@ -176,13 +174,9 @@ class ModuleHelpop : public Module
                        }
                }
 
-               virtual ~ModuleHelpop()
-               {
-               }
-
-               virtual Version GetVersion()
+               Version GetVersion()
                {
-                       return Version("/helpop Command, Works like Unreal helpop", VF_VENDOR | VF_COMMON);
+                       return Version("/help command, works like Unreal helpop", VF_VENDOR);
                }
 };