diff options
author | Sadie Powell <sadie@witchery.services> | 2021-08-01 18:53:24 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2021-08-01 18:53:24 +0100 |
commit | 561b205c4a3a125c12a7926ef18fa1eb822c387c (patch) | |
tree | c763ddefe765e23ec0ff189e24d55f634b52b954 /modules/commands/cs_ban.cpp | |
parent | 376053e0acae2a37a8f5c77c8de25ebf8a8395a9 (diff) | |
parent | 91321bdf682eb5b512373bb56c722f943cbc8183 (diff) |
Merge branch '2.0' into 2.1.
Diffstat (limited to 'modules/commands/cs_ban.cpp')
-rw-r--r-- | modules/commands/cs_ban.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/commands/cs_ban.cpp b/modules/commands/cs_ban.cpp index 113873d2c..648651dfa 100644 --- a/modules/commands/cs_ban.cpp +++ b/modules/commands/cs_ban.cpp @@ -42,10 +42,13 @@ class CommandCSBan : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override { - const Anope::string &chan = params[0]; Configuration::Block *block = Config->GetCommand(source); const Anope::string &mode = block->Get<Anope::string>("mode", "BAN"); + ChannelMode *cm = ModeManager::FindChannelModeByName(mode); + if (cm == NULL) + return; + const Anope::string &chan = params[0]; ChannelInfo *ci = ChannelInfo::Find(chan); if (ci == NULL) { @@ -59,7 +62,7 @@ class CommandCSBan : public Command source.Reply(CHAN_X_NOT_IN_USE, chan.c_str()); return; } - else if (IRCD->GetMaxListFor(c) && c->HasMode(mode) >= IRCD->GetMaxListFor(c)) + else if (IRCD->GetMaxListFor(c, cm) && c->HasMode(mode) >= IRCD->GetMaxListFor(c, cm)) { source.Reply(_("The %s list for %s is full."), mode.lower().c_str(), c->name.c_str()); return; |