From 84b94bdbf1c4c0abf16bb6d54df4505711e12ed6 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 30 Jan 2026 11:09:28 +0100 Subject: [PATCH] Fix some uses of Entry that didn't have their arguments swapped. --- modules/botserv/botserv.cpp | 4 ++-- modules/chanserv/cs_akick.cpp | 10 ++-------- modules/chanserv/cs_ban.cpp | 2 +- modules/chanserv/cs_kick.cpp | 2 +- modules/chanserv/cs_status.cpp | 2 +- modules/operserv/os_ignore.cpp | 2 +- src/channels.cpp | 4 ++-- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/modules/botserv/botserv.cpp b/modules/botserv/botserv.cpp index 4eb035701..d2d5c61a2 100644 --- a/modules/botserv/botserv.cpp +++ b/modules/botserv/botserv.cpp @@ -70,7 +70,7 @@ public: // We have to check for bans. for (const auto &entry : c->GetModeList("BAN")) { - Entry ban("BAN", entry); + Entry ban(entry, "BAN"); if (ban.Matches(user)) c->RemoveMode(NULL, "BAN", ban.GetMask()); } @@ -205,7 +205,7 @@ public: { BotInfo *bi = c->ci->bi; - Entry ban("BAN", data.value); + Entry ban(data.value, "BAN"); if (ban.Matches(bi)) c->RemoveMode(bi, "BAN", data.value); } diff --git a/modules/chanserv/cs_akick.cpp b/modules/chanserv/cs_akick.cpp index c5fddfd52..a01c6362c 100644 --- a/modules/chanserv/cs_akick.cpp +++ b/modules/chanserv/cs_akick.cpp @@ -260,13 +260,7 @@ class CommandCSAKick final } } - Entry e("", mask); - - mask = (e.nick.empty() ? "*" : e.nick) + "!" - + (e.user.empty() ? "*" : e.user) + "@" - + (e.host.empty() ? "*" : e.host); - if (!e.real.empty()) - mask += "#" + e.real; + mask = Entry(mask).GetCleanMask(); } else nc = na->nc; @@ -309,7 +303,7 @@ class CommandCSAKick final for (const auto &[_, u2] : UserListByNick) { AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci); - Entry entry_mask("", mask); + Entry entry_mask(mask); if ((ci->AccessFor(u2).HasPriv("FOUNDER") || nc_access >= u_access) && entry_mask.Matches(u2)) { diff --git a/modules/chanserv/cs_ban.cpp b/modules/chanserv/cs_ban.cpp index f02ae302a..518d1560a 100644 --- a/modules/chanserv/cs_ban.cpp +++ b/modules/chanserv/cs_ban.cpp @@ -216,7 +216,7 @@ public: auto *memb = it->second; ++it; - Entry e(mode, mask); + Entry e(mask, mode); if (e.Matches(memb->user)) { ++matched; diff --git a/modules/chanserv/cs_kick.cpp b/modules/chanserv/cs_kick.cpp index 2e87cf852..1f876cb0b 100644 --- a/modules/chanserv/cs_kick.cpp +++ b/modules/chanserv/cs_kick.cpp @@ -95,7 +95,7 @@ public: auto *memb = it->second; ++it; - Entry e("", mask); + Entry e(mask); if (e.Matches(memb->user)) { ++matched; diff --git a/modules/chanserv/cs_status.cpp b/modules/chanserv/cs_status.cpp index 09b40ba33..58bb370a6 100644 --- a/modules/chanserv/cs_status.cpp +++ b/modules/chanserv/cs_status.cpp @@ -96,7 +96,7 @@ public: } else if (u != NULL) { - Entry akick_mask("", autokick->mask); + Entry akick_mask(autokick->mask); if (akick_mask.Matches(u)) source.Reply(_("\002%s\002 matches auto kick entry %s on \002%s\002 (%s)."), u->nick.c_str(), autokick->mask.c_str(), ci->name.c_str(), autokick->reason.c_str()); } diff --git a/modules/operserv/os_ignore.cpp b/modules/operserv/os_ignore.cpp index 6372705d3..feb758f9a 100644 --- a/modules/operserv/os_ignore.cpp +++ b/modules/operserv/os_ignore.cpp @@ -122,7 +122,7 @@ public: { for (; ign != ign_end; ++ign) { - Entry ignore_mask("", (*ign)->mask); + Entry ignore_mask((*ign)->mask); if (ignore_mask.Matches(u, true)) break; } diff --git a/src/channels.cpp b/src/channels.cpp index 6288958aa..dbba66636 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -737,7 +737,7 @@ bool Channel::MatchesList(User *u, const Anope::string &mode) for (const auto &entry : this->GetModeList(mode)) { - Entry e(mode, entry); + Entry e(entry, mode); if (e.Matches(u)) return true; } @@ -888,7 +888,7 @@ bool Channel::Unban(User *u, const Anope::string &mode, bool full) for (const auto &entry : this->GetModeList(mode)) { - Entry ban(mode, entry); + Entry ban(entry, mode); if (ban.Matches(u, full)) { this->RemoveMode(NULL, mode, ban.GetMask());