]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nokicks.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / m_nokicks.cpp
index 2e598dafea48e43cec6af30ef8d37bcf2b95fc2c..e8bceffd432449e649da9c0858136f8f93b14810 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for unreal-style channel mode +Q */
+/* $ModDesc: Provides channel mode +Q to prevent kicks on the channel. */
 
 class NoKicks : public SimpleChannelModeHandler
 {
@@ -37,6 +37,10 @@ class ModuleNoKicks : public Module
  public:
        ModuleNoKicks()
                : nk(this)
+       {
+       }
+
+       void init()
        {
                if (!ServerInstance->Modes->AddMode(&nk))
                        throw ModuleException("Could not add new modes!");
@@ -53,17 +57,9 @@ class ModuleNoKicks : public Module
        {
                if (!memb->chan->GetExtBanStatus(source, 'Q').check(!memb->chan->IsModeSet('Q')))
                {
-                       if ((ServerInstance->ULine(source->nick.c_str())) || ServerInstance->ULine(source->server))
-                       {
-                               // ulines can still kick with +Q in place
-                               return MOD_RES_PASSTHRU;
-                       }
-                       else
-                       {
-                               // nobody else can (not even opers with override, and founders)
-                               source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Can't kick user %s from channel (+Q set)",source->nick.c_str(), memb->chan->name.c_str(), memb->user->nick.c_str());
-                               return MOD_RES_DENY;
-                       }
+                       // Can't kick with Q in place, not even opers with override, and founders
+                       source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Can't kick user %s from channel (+Q set)",source->nick.c_str(), memb->chan->name.c_str(), memb->user->nick.c_str());
+                       return MOD_RES_DENY;
                }
                return MOD_RES_PASSTHRU;
        }
@@ -74,7 +70,7 @@ class ModuleNoKicks : public Module
 
        Version GetVersion()
        {
-               return Version("Provides support for unreal-style channel mode +Q", VF_VENDOR);
+               return Version("Provides channel mode +Q to prevent kicks on the channel.", VF_VENDOR);
        }
 };