summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-08-03 18:57:00 -0400
committerAdam <Adam@anope.org>2014-08-03 18:57:00 -0400
commitd6d72cd803b2c5bf38e152dc6d00dd6dda720951 (patch)
treedf0ada6e6404e0d834ab5bf6945912cb7cb0de61
parent063d9bf5f689fd9dc24394c267dfdce7b6a345e6 (diff)
Add cs_mode:max config option
-rw-r--r--data/chanserv.example.conf7
-rw-r--r--modules/commands/cs_mode.cpp2
2 files changed, 9 insertions, 0 deletions
diff --git a/data/chanserv.example.conf b/data/chanserv.example.conf
index 86b86291b..474d9d052 100644
--- a/data/chanserv.example.conf
+++ b/data/chanserv.example.conf
@@ -1061,6 +1061,13 @@ module
* If not set, the default is +nt.
*/
mlock = "+nt"
+
+ /*
+ * The maximum number of entries that may be on a mode lock list.
+ *
+ * This directive is optional.
+ */
+ max = 32
}
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index 2943c64a3..7f22d1e26 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -327,6 +327,8 @@ class CommandCSMode : public Command
source.Reply(_("Missing parameter for mode %c."), cm->mchar);
else if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c))
source.Reply(_("List for mode %c is full."), cm->mchar);
+ else if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "32"))
+ source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str());
else
{
modelocks->SetMLock(cm, adding, mode_param, source.GetNick());