From e67c2d563295701ac098bf186b7c1847f579f590 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 4 Jun 2021 02:12:09 +0100 Subject: Add support for per-mode list limits. --- modules/commands/cs_ban.cpp | 7 +++++-- modules/commands/cs_mode.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'modules/commands') 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 ¶ms) anope_override { - const Anope::string &chan = params[0]; Configuration::Block *block = Config->GetCommand(source); const Anope::string &mode = block->Get("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; diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index d5129fdc6..0f6378036 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -336,7 +336,7 @@ class CommandCSMode : public Command continue; } - if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c)) + if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c, cm) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c, cm)) { source.Reply(_("List for mode %c is full."), cm->mchar); continue; @@ -660,7 +660,7 @@ class CommandCSMode : public Command if (adding) { - if (IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) < IRCD->GetMaxListFor(ci->c)) + if (IRCD->GetMaxListFor(ci->c, cm) && ci->c->HasMode(cm->name) < IRCD->GetMaxListFor(ci->c, cm)) ci->c->SetMode(NULL, cm, param); } else -- cgit From fd88b756fc20dedea15a8a08c21e8f7af6612e4e Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 17 Jun 2021 10:02:30 -0400 Subject: Fix various spelling issues (#274). Signed-off-by: Josh Soref . --- modules/commands/bs_kick.cpp | 2 +- modules/commands/ns_cert.cpp | 2 +- modules/commands/ns_group.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/commands') diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 90842df01..1a0ec73df 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -1335,7 +1335,7 @@ class BSKick : public Module Anope::string nbuf = Anope::NormalizeBuffer(realbuf); bool casesensitive = Config->GetModule("botserv")->Get("casesensitive"); - /* Normalize can return an empty string if this only conains control codes etc */ + /* Normalize can return an empty string if this only contains control codes etc */ if (badwords && !nbuf.empty()) for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i) { diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index ab8957011..fec857109 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -55,7 +55,7 @@ struct NSCertListImpl : NSCertList /** Get an entry from the nick's cert list by index * - * @param entry Index in the certificaate list vector to retrieve + * @param entry Index in the certificate list vector to retrieve * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds * * Retrieves an entry from the certificate list corresponding to the given index. diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index c68e53157..aa2865776 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -282,7 +282,7 @@ class CommandNSUngroup : public Command { this->SendSyntax(source); source.Reply(" "); - source.Reply(_("This command ungroups your nick, or if given, the specificed nick,\n" + source.Reply(_("This command ungroups your nick, or if given, the specified nick,\n" "from the group it is in. The ungrouped nick keeps its registration\n" "time, password, email, greet, language, and url. Everything else\n" "is reset. You may not ungroup yourself if there is only one nick in\n" -- cgit