1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 23:03:13 +02:00

Allow clearing other list modes using ClearBans.

This commit is contained in:
Sadie Powell
2025-04-15 14:44:41 +01:00
parent d891f2bcbd
commit 5c2fc1cedd
5 changed files with 42 additions and 25 deletions
+17 -13
View File
@@ -44,16 +44,18 @@ public:
if (!ci->c || !(source.AccessFor(ci).HasPriv("UNBAN") || source.AccessFor(ci).HasPriv("UNBANME")))
continue;
if (IRCD->CanClearBans)
{
IRCD->SendClearBans(ci->WhoSends(), ci->c, source.GetUser());
count++;
continue;
}
for (const auto *mode : modes)
{
if (IRCD->CanClearModes.count(mode->name))
{
IRCD->SendClearModes(ci->WhoSends(), ci->c, source.GetUser(), mode->name);
count++;
continue;
}
if (ci->c->Unban(source.GetUser(), mode->name, true))
++count;
}
}
Log(LOG_COMMAND, source, this, NULL) << "on all channels";
@@ -96,13 +98,15 @@ public:
bool override = !source.AccessFor(ci).HasPriv("UNBAN") && source.HasPriv("chanserv/kick");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to unban " << u2->nick;
if (IRCD->CanClearBans)
IRCD->SendClearBans(ci->WhoSends(), ci->c, source.GetUser());
else
for (const auto *mode : modes)
{
for (const auto *mode : modes)
ci->c->Unban(u2, mode->name, source.GetUser() == u2);
if (IRCD->CanClearModes.count(mode->name))
{
IRCD->SendClearModes(ci->WhoSends(), ci->c, source.GetUser(), mode->name);
continue;
}
ci->c->Unban(u2, mode->name, source.GetUser() == u2);
}
if (u2 == source.GetUser())