From f36915790674275627cf8eb68024e17539ee04fa Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 11 Apr 2014 16:10:30 -0400 Subject: Use OnChanRegistered instead of OnCreateChan to set default mlocks. Because OnCreateChan is called from ChannelInfo's constructor, during DB loading it could cause mode locks to be unserialized without having all channels loaded, which breaks things. --- modules/commands/cs_mode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/commands/cs_mode.cpp') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index a13610d23..941a6d183 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -951,7 +951,7 @@ class CSMode : public Module } } - void OnCreateChan(ChannelInfo *ci) anope_override + void OnChanRegistered(ChannelInfo *ci) anope_override { ModeLocks *ml = modelocks.Require(ci); Anope::string mlock; -- cgit From 6a03eb69ebbe773f1d4139ff88d74ecdb2b0af4b Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 25 Apr 2014 16:51:06 -0400 Subject: Add "virtual mode" support This allows fully tracking extbans and other modes set by a different underlying mode, such as InspIRCd's namedmodes Add two configuration options to cs_ban to configure which mode is set and whether or not to kick banned users. Add default "mute" fantasy command to botserv.example.conf --- modules/commands/cs_mode.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/commands/cs_mode.cpp') diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 941a6d183..2943c64a3 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -488,8 +488,7 @@ class CommandCSMode : public Command for (unsigned j = 0; j < ModeManager::GetChannelModes().size(); ++j) { ChannelMode *cm = ModeManager::GetChannelModes()[j]; - if (!cm) - continue; + if (!u || cm->CanSet(u) || can_override) { if (cm->type == MODE_REGULAR || (!adding && cm->type == MODE_PARAM)) -- cgit