]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hideoper.cpp
Delete modewatchers when unloading modules that use them to keep the server from...
[user/henk/code/inspircd.git] / src / modules / m_hideoper.cpp
index b9ea5fa2a02f5d3830cafd335167e2754cfa70bc..80fee268fc85907fb9685a6e4328f2ccc8ab1256 100644 (file)
@@ -20,7 +20,7 @@
 class HideOper : public ModeHandler
 {
  public:
-       HideOper(Module* Creator) : ModeHandler(Creator, 'H', PARAM_NONE, MODETYPE_USER)
+       HideOper(Module* Creator) : ModeHandler(Creator, "hideoper", 'H', PARAM_NONE, MODETYPE_USER)
        {
                oper = true;
        }
@@ -55,22 +55,20 @@ class ModuleHideOper : public Module
        ModuleHideOper()
                : hm(this)
        {
-
                if (!ServerInstance->Modes->AddMode(&hm))
                        throw ModuleException("Could not add new modes!");
-               Implementation eventlist[] = { I_OnWhoisLine };
-               ServerInstance->Modules->Attach(eventlist, this, 1);
+               Implementation eventlist[] = { I_OnWhoisLine, I_OnSendWhoLine };
+               ServerInstance->Modules->Attach(eventlist, this, 2);
        }
 
 
        virtual ~ModuleHideOper()
        {
-               ServerInstance->Modes->DelMode(&hm);
        }
 
        virtual Version GetVersion()
        {
-               return Version("Provides support for hiding oper status with user mode +H", VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("Provides support for hiding oper status with user mode +H", VF_COMMON | VF_VENDOR);
        }
 
        ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text)