]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hidechans.cpp
Some more to fix still, modules probably wont load correctly atm
[user/henk/code/inspircd.git] / src / modules / m_hidechans.cpp
index 8d2c6b4ebf623239afb1c1f1b6595644bc1d51db..cb910aa4b89baa3bccdcdb34cf2bb0bc0951cf8c 100644 (file)
@@ -22,7 +22,7 @@ class HideChans : public ModeHandler
  public:
        HideChans(InspIRCd* Instance) : ModeHandler(Instance, 'I', 0, 0, false, MODETYPE_USER, false) { }
 
-       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,8 +59,10 @@ class ModuleHideChans : public Module
        {
                
                hm = new HideChans(ServerInstance);
-               if (!ServerInstance->AddMode(hm, 'I'))
+               if (!ServerInstance->AddMode(hm))
                        throw ModuleException("Could not add new modes!");
+               Implementation eventlist[] = { I_OnWhoisLine };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
        void Implements(char* List)
@@ -79,7 +81,7 @@ class ModuleHideChans : public Module
                return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 
-       int OnWhoisLine(userrec* user, userrec* dest, int &numeric, std::string &text)
+       int OnWhoisLine(User* user, User* dest, int &numeric, std::string &text)
        {
                /* Dont display channels if they have +I set and the
                 * person doing the WHOIS is not an oper