]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanprotect.cpp
Fix bug #509 reported by Casey: bans were not applied on non-opped users (1.2 only)
[user/henk/code/inspircd.git] / src / modules / m_chanprotect.cpp
index 768c7eb8c254c287f5d3bd9d6c9eddcf52627eaf..e85744d06a242ebca6bbb31a9207e309ec96057c 100644 (file)
@@ -300,8 +300,8 @@ class ModuleChanProtect : public Module
  public:
  
        ModuleChanProtect(InspIRCd* Me)
-               : Module(Me), FirstInGetsFounder(false), QPrefix(0), APrefix(0), DeprivSelf(false), DeprivOthers(false), booting(true)
-       {       
+               : Module(Me), FirstInGetsFounder(false), QPrefix(0), APrefix(0), DeprivSelf(false), DeprivOthers(false), booting(true), cp(NULL), cf(NULL)
+       {
                /* Load config stuff */
                OnRehash(NULL,"");
                booting = false;
@@ -359,6 +359,12 @@ class ModuleChanProtect : public Module
                if ((APrefix && QPrefix) && APrefix == QPrefix)
                        throw CoreException("What the smeg, why are both your +q and +a prefixes the same character?");
 
+               if (cp && ServerInstance->Modes->FindPrefix(APrefix) == cp)
+                       throw CoreException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
+
+               if (cf && ServerInstance->Modes->FindPrefix(QPrefix) == cf)
+                       throw CoreException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
+
                DeprivSelf = Conf.ReadFlag("options","deprotectself",0);
                DeprivOthers = Conf.ReadFlag("options","deprotectothers",0);