-
- FirstInGetsFounder = Conf.ReadFlag("options","noservices",0);
- QAPrefixes = Conf.ReadFlag("options","qaprefixes",0);
+
+ FirstInGetsFounder = Conf.ReadFlag("chanprotect", "noservices", 0);
+
+ std::string qpre = Conf.ReadValue("chanprotect", "qprefix", 0);
+ QPrefix = qpre.empty() ? 0 : qpre[0];
+
+ std::string apre = Conf.ReadValue("chanprotect", "aprefix", 0);
+ APrefix = apre.empty() ? 0 : apre[0];
+
+ if ((APrefix && QPrefix) && APrefix == QPrefix)
+ throw ModuleException("What the smeg, why are both your +q and +a prefixes the same character?");
+
+ if (cp && ServerInstance->Modes->FindPrefix(APrefix) == cp)
+ throw ModuleException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
+
+ if (cf && ServerInstance->Modes->FindPrefix(QPrefix) == cf)
+ throw ModuleException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
+
+ DeprivSelf = Conf.ReadFlag("chanprotect","deprotectself", "yes", 0);
+ DeprivOthers = Conf.ReadFlag("chanprotect","deprotectothers", "yes", 0);