+ ServerInstance->Logs->Log("chanprotect", DEBUG, "qprefix is %c and aprefix is %c", QPrefix, APrefix);
+
/* Did the user change the QA prefixes on the fly?
* If so, remove all instances of the mode, and reinit
* the module with prefixes enabled.
*/
- if ((old_qa != QAPrefixes) && (!booting))
+ if ((old_q != QPrefix) && (!booting))
{
- ServerInstance->Modes->DelMode(cp);
ServerInstance->Modes->DelMode(cf);
- delete cp;
delete cf;
- cp = new ChanProtect(ServerInstance,QAPrefixes,DeprivSelf,DeprivOthers);
- cf = new ChanFounder(ServerInstance,QAPrefixes,DeprivSelf,DeprivOthers);
+ cf = new ChanFounder(ServerInstance, QPrefix, DeprivSelf, DeprivOthers);
/* These wont fail, we already owned the mode characters before */
- ServerInstance->AddMode(cp);
- ServerInstance->AddMode(cf);
+ ServerInstance->Modes->AddMode(cf);
+ ServerInstance->SNO->WriteToSnoMask('A', "WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change.");
+ }
+
+ if ((old_a != APrefix) && (!booting))
+ {
+ ServerInstance->Modes->DelMode(cp);
+ delete cp;
+ cp = new ChanProtect(ServerInstance, APrefix, DeprivSelf, DeprivOthers);
+ ServerInstance->Modes->AddMode(cp);
ServerInstance->SNO->WriteToSnoMask('A', "WARNING: +qa prefixes were enabled or disabled via a REHASH. Clients will probably need to reconnect to pick up this change.");
}
}
@@ -374,7+389,7 @@ class ModuleChanProtect : public Module
// the config option for it is set
if (FirstInGetsFounder && !chan)
- privs = "~@";
+ privs = QPrefix + "@";
return 0;
}
@@ -419,12+434,12 @@ class ModuleChanProtect : public Module
case AC_DEOP:
if (dest->GetExt(founder,dummyptr))
{
- source->WriteServ("484 "+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder");
+ source->WriteNumeric(484, ""+std::string(source->nick)+" "+std::string(channel->name)+" :Can't deop "+std::string(dest->nick)+" as they're a channel founder");
return ACR_DENY;
}
if ((dest->GetExt(protect,dummyptr)) && (!source->GetExt(protect,dummyptr)))