diff options
Diffstat (limited to 'modules/chanserv/cs_unban.cpp')
-rw-r--r-- | modules/chanserv/cs_unban.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/chanserv/cs_unban.cpp b/modules/chanserv/cs_unban.cpp index 09dcee602..d87388bc2 100644 --- a/modules/chanserv/cs_unban.cpp +++ b/modules/chanserv/cs_unban.cpp @@ -44,16 +44,18 @@ public: if (!ci->c || !(source.AccessFor(ci).HasPriv("UNBAN") || source.AccessFor(ci).HasPriv("UNBANME"))) continue; - if (IRCD->CanClearBans) + for (const auto *mode : modes) { - IRCD->SendClearBans(ci->WhoSends(), ci->c, source.GetUser()); - count++; - continue; - } + if (IRCD->CanClearModes.count(mode->name)) + { + IRCD->SendClearModes(ci->WhoSends(), ci->c, source.GetUser(), mode->name); + count++; + continue; + } - for (const auto *mode : modes) 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()) |