diff options
-rw-r--r-- | language/anope.en_US.po | 32 | ||||
-rw-r--r-- | modules/botserv/bs_badwords.cpp | 22 | ||||
-rw-r--r-- | modules/chanserv/cs_access.cpp | 6 | ||||
-rw-r--r-- | modules/chanserv/cs_akick.cpp | 22 | ||||
-rw-r--r-- | modules/chanserv/cs_xop.cpp | 5 | ||||
-rw-r--r-- | modules/operserv/os_akill.cpp | 20 | ||||
-rw-r--r-- | modules/operserv/os_session.cpp | 22 | ||||
-rw-r--r-- | modules/operserv/os_sxline.cpp | 20 |
8 files changed, 122 insertions, 27 deletions
diff --git a/language/anope.en_US.po b/language/anope.en_US.po index 15d5dc6e3..dfd101bb0 100644 --- a/language/anope.en_US.po +++ b/language/anope.en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Anope\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-22 18:32+0100\n" -"PO-Revision-Date: 2025-04-16 02:59+0100\n" +"POT-Creation-Date: 2025-04-23 01:56+0100\n" +"PO-Revision-Date: 2025-04-23 01:56+0100\n" "Last-Translator: Sadie Powell <sadie@witchery.services>\n" "Language-Team: English\n" "Language: en_US\n" @@ -2460,6 +2460,34 @@ msgstr[0] "" msgstr[1] "" #, c-format +msgid "Deleted %s from %s %s list." +msgstr "" + +#, c-format +msgid "Deleted %s from %s access list." +msgstr "" + +#, c-format +msgid "Deleted %s from %s autokick list." +msgstr "" + +#, c-format +msgid "Deleted %s from %s bad words list." +msgstr "" + +#, c-format +msgid "Deleted %s from session-limit exception list." +msgstr "" + +#, c-format +msgid "Deleted %s from the %s list." +msgstr "" + +#, c-format +msgid "Deleted %s from the AKILL list." +msgstr "" + +#, c-format msgid "Deleted %u entry from your message queue." msgid_plural "Deleted %u entries from your message queue." msgstr[0] "" diff --git a/modules/botserv/bs_badwords.cpp b/modules/botserv/bs_badwords.cpp index 48d101c56..a8980066a 100644 --- a/modules/botserv/bs_badwords.cpp +++ b/modules/botserv/bs_badwords.cpp @@ -165,6 +165,7 @@ class BadwordsDelCallback final BadWords *bw; Command *c; unsigned deleted = 0; + Anope::string lastdeleted; bool override = false; public: BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c) @@ -176,10 +177,20 @@ public: ~BadwordsDelCallback() override { - if (deleted) - source.Reply(deleted, N_("Deleted %d entry from %s bad words list.", "Deleted %d entries from %s bad words list."), deleted, ci->name.c_str()); - else - source.Reply(_("No matching entries on %s bad words list."), ci->name.c_str()); + switch (deleted) + { + case 0: + source.Reply(_("No matching entries on %s bad words list."), ci->name.c_str()); + break; + + case 1: + source.Reply(_("Deleted %s from %s bad words list."), lastdeleted.c_str(), ci->name.c_str()); + break; + + default: + source.Reply(deleted, N_("Deleted %d entry from %s bad words list.", "Deleted %d entries from %s bad words list."), deleted, ci->name.c_str()); + break; + } } void HandleNumber(unsigned Number) override @@ -187,7 +198,8 @@ public: if (!bw || !Number || Number > bw->GetBadWordCount()) return; - Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "DEL " << bw->GetBadWord(Number - 1)->word; + lastdeleted = bw->GetBadWord(Number - 1)->word; + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "DEL " << lastdeleted; ++deleted; bw->EraseBadWord(Number - 1); } diff --git a/modules/chanserv/cs_access.cpp b/modules/chanserv/cs_access.cpp index 43082ee02..a082b131c 100644 --- a/modules/chanserv/cs_access.cpp +++ b/modules/chanserv/cs_access.cpp @@ -284,7 +284,11 @@ class CommandCSAccess final else { Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << Nicks; - source.Reply(deleted, N_("Deleted %d entry from %s access list.", "Deleted %d entries from %s access list."), deleted, ci->name.c_str()); + if (deleted == 1) + source.Reply(_("Deleted %s from %s access list."), Nicks.c_str(), ci->name.c_str()); + + else + source.Reply(deleted, N_("Deleted %d entry from %s access list.", "Deleted %d entries from %s access list."), deleted, ci->name.c_str()); } } diff --git a/modules/chanserv/cs_akick.cpp b/modules/chanserv/cs_akick.cpp index ef63c4d3f..a7b7506b4 100644 --- a/modules/chanserv/cs_akick.cpp +++ b/modules/chanserv/cs_akick.cpp @@ -211,6 +211,7 @@ class CommandCSAKick final ChannelInfo *ci; Command *c; unsigned deleted = 0; + Anope::string lastdeleted; AccessGroup ag; public: AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), ag(source.AccessFor(ci)) @@ -219,10 +220,20 @@ class CommandCSAKick final ~AkickDelCallback() override { - if (deleted) - source.Reply(deleted, N_("Deleted %d entry from %s autokick list.", "Deleted %d entries from %s autokick list."), deleted, ci->name.c_str()); - else - source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str()); + switch (deleted) + { + case 0: + source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str()); + break; + + case 1: + source.Reply(_("Deleted %s from %s autokick list."), lastdeleted.c_str(), ci->name.c_str()); + break; + + default: + source.Reply(deleted, N_("Deleted %d entry from %s autokick list.", "Deleted %d entries from %s autokick list."), deleted, ci->name.c_str()); + break; + } } void HandleNumber(unsigned number) override @@ -235,7 +246,8 @@ class CommandCSAKick final FOREACH_MOD(OnAkickDel, (source, ci, akick)); bool override = !ag.HasPriv("AKICK"); - Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << (akick->nc ? akick->nc->display : akick->mask); + lastdeleted = (akick->nc ? akick->nc->display : akick->mask); + Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << lastdeleted; ++deleted; ci->EraseAkick(number - 1); diff --git a/modules/chanserv/cs_xop.cpp b/modules/chanserv/cs_xop.cpp index feddbacd7..8fa5b3bb2 100644 --- a/modules/chanserv/cs_xop.cpp +++ b/modules/chanserv/cs_xop.cpp @@ -319,7 +319,10 @@ private: else { Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << nicks; - source.Reply(deleted, N_("Deleted %d entry from %s %s list.", "Deleted %d entries from %s %s list."), deleted, ci->name.c_str(), source.command.nobreak().c_str()); + if (deleted == 1) + source.Reply(_("Deleted %s from %s %s list."), nicks.c_str(), ci->name.c_str(), source.command.nobreak().c_str()); + else + source.Reply(deleted, N_("Deleted %d entry from %s %s list.", "Deleted %d entries from %s %s list."), deleted, ci->name.c_str(), source.command.nobreak().c_str()); } } diff --git a/modules/operserv/os_akill.cpp b/modules/operserv/os_akill.cpp index b31f5404d..b6081abba 100644 --- a/modules/operserv/os_akill.cpp +++ b/modules/operserv/os_akill.cpp @@ -18,6 +18,7 @@ class AkillDelCallback final { CommandSource &source; unsigned deleted = 0; + Anope::string lastdeleted; Command *cmd; public: AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c) @@ -26,10 +27,20 @@ public: ~AkillDelCallback() override { - if (deleted) - source.Reply(deleted, N_("Deleted %d entry from the AKILL list.", "Deleted %d entries from the AKILL list."), deleted); - else - source.Reply(_("No matching entries on the AKILL list.")); + switch (deleted) + { + case 0: + source.Reply(_("No matching entries on the AKILL list.")); + break; + + case 1: + source.Reply(_("Deleted %s from the AKILL list."), lastdeleted.c_str()); + break; + + default: + source.Reply(deleted, N_("Deleted %d entry from the AKILL list.", "Deleted %d entries from the AKILL list."), deleted); + break; + } } void HandleNumber(unsigned number) override @@ -42,6 +53,7 @@ public: if (!x) return; + lastdeleted = x->mask; Log(LOG_ADMIN, source, cmd) << "to remove " << x->mask << " from the list"; ++deleted; diff --git a/modules/operserv/os_session.cpp b/modules/operserv/os_session.cpp index de554140b..adbe23676 100644 --- a/modules/operserv/os_session.cpp +++ b/modules/operserv/os_session.cpp @@ -174,6 +174,7 @@ class ExceptionDelCallback final protected: CommandSource &source; unsigned deleted = 0; + Anope::string lastdeleted; Command *cmd; public: ExceptionDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c) @@ -182,10 +183,20 @@ public: ~ExceptionDelCallback() override { - if (deleted) - source.Reply(deleted, N_("Deleted %d entry from session-limit exception list.", "Deleted %d entries from session-limit exception list."), deleted); - else - source.Reply(_("No matching entries on session-limit exception list.")); + switch (deleted) + { + case 0: + source.Reply(_("No matching entries on session-limit exception list.")); + break; + + case 1: + source.Reply(_("Deleted %s from session-limit exception list."), lastdeleted.c_str()); + break; + + default: + source.Reply(deleted, N_("Deleted %d entry from session-limit exception list.", "Deleted %d entries from session-limit exception list."), deleted); + break; + } } void HandleNumber(unsigned number) override @@ -193,7 +204,8 @@ public: if (!number || number > session_service->GetExceptions().size()) return; - Log(LOG_ADMIN, source, cmd) << "to remove the session limit exception for " << session_service->GetExceptions()[number - 1]->mask; + lastdeleted = session_service->GetExceptions()[number - 1]->mask; + Log(LOG_ADMIN, source, cmd) << "to remove the session limit exception for " << lastdeleted; ++deleted; DoDel(source, number - 1); diff --git a/modules/operserv/os_sxline.cpp b/modules/operserv/os_sxline.cpp index f19cc529c..c81bd51d4 100644 --- a/modules/operserv/os_sxline.cpp +++ b/modules/operserv/os_sxline.cpp @@ -18,6 +18,7 @@ class SXLineDelCallback final Command *command; CommandSource &source; unsigned deleted = 0; + Anope::string lastdeleted; public: SXLineDelCallback(XLineManager *x, Command *c, CommandSource &_source, const Anope::string &numlist) : NumberList(numlist, true), xlm(x), command(c), source(_source) { @@ -25,10 +26,20 @@ public: ~SXLineDelCallback() override { - if (deleted) - source.Reply(deleted, N_("Deleted %d entry from the %s list.", "Deleted %d entries from the %s list."), deleted, source.command.nobreak().c_str()); - else - source.Reply(_("No matching entries on the %s list."), source.command.nobreak().c_str()); + switch (deleted) + { + case 0: + source.Reply(deleted, N_("Deleted %d entry from the %s list.", "Deleted %d entries from the %s list."), deleted, source.command.nobreak().c_str()); + break; + + case 1: + source.Reply(_("Deleted %s from the %s list."), lastdeleted.c_str(), source.command.nobreak().c_str()); + break; + + default: + source.Reply(_("No matching entries on the %s list."), source.command.nobreak().c_str()); + break; + } } void HandleNumber(unsigned number) override @@ -41,6 +52,7 @@ public: if (!x) return; + lastdeleted = x->mask; Log(LOG_ADMIN, source, command) << "to remove " << x->mask << " from the list"; ++deleted; |