* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
{
public:
ChanProtect(Module* Creator)
- : ModeHandler(Creator, "protected", 'a', PARAM_ALWAYS, MODETYPE_CHANNEL),
+ : ModeHandler(Creator, "admin", 'a', PARAM_ALWAYS, MODETYPE_CHANNEL),
FounderProtectBase('a',"protected user", 388, 389)
{
ModeHandler::list = true;
ChanFounder cf;
public:
ModuleChanProtect() : cp(this), cf(this)
+ {
+ }
+
+ void init()
{
/* Load config stuff */
LoadSettings();
settings.booting = false;
- if (!ServerInstance->Modes->AddMode(&cp) || !ServerInstance->Modes->AddMode(&cf))
- {
- throw ModuleException("Could not add new modes!");
- }
+ ServerInstance->Modules->AddService(cf);
+ ServerInstance->Modules->AddService(cp);
Implementation eventlist[] = { I_OnUserPreJoin };
ServerInstance->Modules->Attach(eventlist, this, 1);
if ((APrefix && QPrefix) && APrefix == QPrefix)
throw ModuleException("What the smeg, why are both your +q and +a prefixes the same character?");
- if (ServerInstance->Modes->FindPrefix(APrefix) && ServerInstance->Modes->FindPrefix(APrefix) != &cp)
- throw ModuleException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
-
- if (ServerInstance->Modes->FindPrefix(QPrefix) && ServerInstance->Modes->FindPrefix(QPrefix) != &cf)
- throw ModuleException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
-
if (settings.booting)
{
+ if (APrefix && ServerInstance->Modes->FindPrefix(APrefix) && ServerInstance->Modes->FindPrefix(APrefix) != &cp)
+ throw ModuleException("Looks like the +a prefix you picked for m_chanprotect is already in use. Pick another.");
+
+ if (QPrefix && ServerInstance->Modes->FindPrefix(QPrefix) && ServerInstance->Modes->FindPrefix(QPrefix) != &cf)
+ throw ModuleException("Looks like the +q prefix you picked for m_chanprotect is already in use. Pick another.");
+
cp.setPrefix(APrefix);
cf.setPrefix(QPrefix);
}
Version GetVersion()
{
- return Version("Founder and Protect modes (+qa)", VF_COMMON | VF_VENDOR);
+ return Version("Founder and Protect modes (+qa)", VF_VENDOR);
}
};