]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_exemptchanops.cpp
Delete modewatchers when unloading modules that use them to keep the server from...
[user/henk/code/inspircd.git] / src / modules / m_exemptchanops.cpp
index ae2a80b02927cfc359921c3d29448e3e2c6884e2..8b3fbf074a9f71ea9a7a794918197fcebd213a6a 100644 (file)
@@ -73,12 +73,11 @@ class ModuleExemptChanOps : public Module
                ServerInstance->Modules->Attach(eventlist, this, 4);
 
                OnRehash(NULL);
-               ServerInstance->Modules->PublishInterface("ChannelBanList", this);
        }
 
        virtual Version GetVersion()
        {
-               return Version("Provides the ability to allow channel operators to be exempt from certain modes.",VF_VENDOR|VF_COMMON,API_VERSION);
+               return Version("Provides the ability to allow channel operators to be exempt from certain modes.",VF_VENDOR|VF_COMMON);
        }
 
        virtual void OnRehash(User* user)
@@ -99,12 +98,12 @@ class ModuleExemptChanOps : public Module
                ec.DoSyncChannel(chan, proto, opaque);
        }
 
-       virtual ModResult OnChannelRestrictionApply(Membership* memb, Channel* chan, const char* restriction)
+       virtual ModResult OnChannelRestrictionApply(User* user, Channel* chan, const char* restriction)
        {
                irc::spacesepstream allowstream(alwaysexempt), denystream(neverexempt);
                std::string current;
 
-               if (memb->getRank() != OP_VALUE)
+               if (chan->GetPrefixValue(user) != OP_VALUE)
                        return MOD_RES_PASSTHRU; // They're not opped, so we don't exempt them
                while(denystream.GetToken(current))
                        if (!strcasecmp(restriction, current.c_str())) return MOD_RES_PASSTHRU; // This mode is set to never allow exemptions in the config
@@ -120,11 +119,6 @@ class ModuleExemptChanOps : public Module
 
                return MOD_RES_PASSTHRU;
        }
-
-       virtual ~ModuleExemptChanOps()
-       {
-               ServerInstance->Modules->UnpublishInterface("ChannelBanList", this);
-       }
 };
 
 MODULE_INIT(ModuleExemptChanOps)