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

Use CanClearBans/SendClearBans when enforcing smartjoin.

This commit is contained in:
Sadie Powell
2024-08-22 00:29:30 +01:00
parent 27beb8f877
commit a3edb09eda
+13 -5
View File
@@ -57,12 +57,20 @@ public:
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
{
/* We check for bans */
for (const auto &entry : c->GetModeList("BAN"))
if (IRCD->CanClearBans)
{
Entry ban("BAN", entry);
if (ban.Matches(user))
c->RemoveMode(NULL, "BAN", ban.GetMask());
// We can ask the IRCd to clear bans.
IRCD->SendClearBans(bi, c, bi);
}
else
{
// We have to check for bans.
for (const auto &entry : c->GetModeList("BAN"))
{
Entry ban("BAN", entry);
if (ban.Matches(user))
c->RemoveMode(NULL, "BAN", ban.GetMask());
}
}
Anope::string Limit;