From a856e80b1ee2cd5d7ce1f79f866f3f310c7b9f00 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 15 May 2026 09:03:39 +0100 Subject: [PATCH] Move migration messages to cs_flags, split non-migratable and non-migrated. --- include/language.h | 4 ---- language/anope.en_US.po | 30 +++++++++++++++++++++--------- modules/chanserv/cs_flags.cpp | 28 ++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/include/language.h b/include/language.h index 200887170..51e673a15 100644 --- a/include/language.h +++ b/include/language.h @@ -142,10 +142,6 @@ namespace Language #define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.") #define CHAN_ACCESS_MALFORMED _("You cannot add a malformed mask to an access list. Did you mean to add %s instead?") #define CHAN_ACCESS_FOREIGN N_("%u access entry from other access systems not shown; use \002%s\033ALL\002 to view all access entries.", "%u access entries from other access systems not shown; use \002%s\033ALL\002 to view all access entries.") -#define CHAN_ACCESS_MIGRATED_1 _("\002%s\002 has been migrated to the %s access system.") -#define CHAN_ACCESS_MIGRATED_N N_("\002%u\002 entry has been migrated to the %s access system.", "\002%u\002 entries have been migrated to the %s access system.") -#define CHAN_ACCESS_NOT_MIGRATED_1 _("\002%s\002 can not be migrated to the %s access system because they have privileges that you do not or they have no migratable privileges.") -#define CHAN_ACCESS_NOT_MIGRATED_N N_("\002%u\002 entry can not be migrated to the %s access system because they have privileges that you do not.", "\002%u\002 entries can not be migrated to the %s access system because they have privileges that you do not or they have no migratable privileges.") #define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.") #define CHAN_INFO_HEADER _("Information about channel \002%s\002:") #define CHAN_LIMIT_EXCEEDED _("You have already exceeded your limit of \002%d\002 channels.") diff --git a/language/anope.en_US.po b/language/anope.en_US.po index 770db5fd4..2228a6d90 100644 --- a/language/anope.en_US.po +++ b/language/anope.en_US.po @@ -16,8 +16,8 @@ msgid "" msgstr "" "Project-Id-Version: Anope\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-05-15 08:42+0100\n" -"PO-Revision-Date: 2026-05-15 08:42+0100\n" +"POT-Creation-Date: 2026-05-15 09:05+0100\n" +"PO-Revision-Date: 2026-05-15 09:05+0100\n" "Last-Translator: Sadie Powell \n" "Language-Team: English\n" "Language: en_US\n" @@ -129,9 +129,14 @@ msgstr "" msgid "%s already exists on the EXCEPTION list." msgstr "" -#: ../include/language.h +#: ../modules/chanserv/cs_flags.cpp #, c-format -msgid "%s can not be migrated to the %s access system because they have privileges that you do not or they have no migratable privileges." +msgid "%s can not be migrated to the %s access system because they have no migratable privileges." +msgstr "" + +#: ../modules/chanserv/cs_flags.cpp +#, c-format +msgid "%s can not be migrated to the %s access system because they have privileges that you do not." msgstr "" #: ../modules/botserv/bs_kick.cpp @@ -215,7 +220,7 @@ msgstr "" msgid "%s has been joined to %s." msgstr "" -#: ../include/language.h +#: ../modules/chanserv/cs_flags.cpp #, c-format msgid "%s has been migrated to the %s access system." msgstr "" @@ -428,14 +433,21 @@ msgstr "" msgid "%s will now permanently be ignored." msgstr "" -#: ../include/language.h +#: ../modules/chanserv/cs_flags.cpp #, c-format -msgid "%u entry can not be migrated to the %s access system because they have privileges that you do not." -msgid_plural "%u entries can not be migrated to the %s access system because they have privileges that you do not or they have no migratable privileges." +msgid "%u entry can not be migrated to the %s access system because they have no migratable privileges." +msgid_plural "%u entries can not be migrated to the %s access system because they have no migratable privileges." msgstr[0] "" msgstr[1] "" -#: ../include/language.h +#: ../modules/chanserv/cs_flags.cpp +#, c-format +msgid "%u entry can not be migrated to the %s access system because they have privileges that you do not." +msgid_plural "%u entries can not be migrated to the %s access system because they have privileges that you do not." +msgstr[0] "" +msgstr[1] "" + +#: ../modules/chanserv/cs_flags.cpp #, c-format msgid "%u entry has been migrated to the %s access system." msgid_plural "%u entries have been migrated to the %s access system." diff --git a/modules/chanserv/cs_flags.cpp b/modules/chanserv/cs_flags.cpp index 7c3bfaf45..6cd3c28bc 100644 --- a/modules/chanserv/cs_flags.cpp +++ b/modules/chanserv/cs_flags.cpp @@ -14,6 +14,13 @@ #include "module.h" +#define FLAGS_MIGRATED_1 _("\002%s\002 has been migrated to the %s access system.") +#define FLAGS_MIGRATED_N N_("\002%u\002 entry has been migrated to the %s access system.", "\002%u\002 entries have been migrated to the %s access system.") +#define FLAGS_NOT_MIGRATABLE_1 _("\002%s\002 can not be migrated to the %s access system because they have no migratable privileges.") +#define FLAGS_NOT_MIGRATABLE_N N_("\002%u\002 entry can not be migrated to the %s access system because they have no migratable privileges.", "\002%u\002 entries can not be migrated to the %s access system because they have no migratable privileges.") +#define FLAGS_NOT_MIGRATED_1 _("\002%s\002 can not be migrated to the %s access system because they have privileges that you do not.") +#define FLAGS_NOT_MIGRATED_N N_("\002%u\002 entry can not be migrated to the %s access system because they have privileges that you do not.", "\002%u\002 entries can not be migrated to the %s access system because they have privileges that you do not.") + static std::map defaultFlags; static Anope::map migrationRequires; @@ -414,8 +421,8 @@ class CommandCSFlags final auto override = false; const auto source_access = source.AccessFor(ci); - unsigned migrated = 0, notmigrated = 0; - Anope::string migratedmask, notmigratedmask; + unsigned migrated = 0, notmigratable = 0, notmigrated = 0; + Anope::string migratedmask, notmigratablemask, notmigratedmask; const auto &entry = params.size() > 2 ? params[2] : "*"; for (auto idx = ci->GetAccessCount(); idx > 0; --idx) { @@ -458,8 +465,8 @@ class CommandCSFlags final if (newflags.empty()) { - notmigrated++; - notmigratedmask = access->Mask(); + notmigratable++; + notmigratablemask = access->Mask(); Log(LOG_DEBUG) << access->Mask() << " has " << access->AccessSerialize() << " that can not be migrated to flags"; continue; // No privs that are migratable } @@ -485,18 +492,23 @@ class CommandCSFlags final if (migrated == 1) { Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to migrate " << migratedmask; - source.Reply(CHAN_ACCESS_MIGRATED_1, migratedmask.c_str(), source.command.nobreak().c_str()); + source.Reply(FLAGS_MIGRATED_1, migratedmask.c_str(), source.command.nobreak().c_str()); } else if (migrated > 1) { Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to migrate " << migrated << " access entries"; - source.Reply(migrated, CHAN_ACCESS_MIGRATED_N, migrated, source.command.nobreak().c_str()); + source.Reply(migrated, FLAGS_MIGRATED_N, migrated, source.command.nobreak().c_str()); } + if (notmigratable == 1) + source.Reply(FLAGS_NOT_MIGRATABLE_1, notmigratablemask.c_str(), source.command.nobreak().c_str()); + else if (notmigratable > 1) + source.Reply(notmigratable, FLAGS_NOT_MIGRATABLE_N, notmigratable, source.command.nobreak().c_str()); + if (notmigrated == 1) - source.Reply(CHAN_ACCESS_NOT_MIGRATED_1, notmigratedmask.c_str(), source.command.nobreak().c_str()); + source.Reply(FLAGS_NOT_MIGRATED_1, notmigratedmask.c_str(), source.command.nobreak().c_str()); else if (notmigrated > 1) - source.Reply(migrated, CHAN_ACCESS_NOT_MIGRATED_N, notmigrated, source.command.nobreak().c_str()); + source.Reply(notmigrated, FLAGS_NOT_MIGRATED_N, notmigrated, source.command.nobreak().c_str()); } void DoClear(CommandSource &source, ChannelInfo *ci)