From a3edb09eda6da745b630c935c8e7a1188e9dade9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 22 Aug 2024 00:29:30 +0100 Subject: [PATCH] Use CanClearBans/SendClearBans when enforcing smartjoin. --- modules/botserv/botserv.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/botserv/botserv.cpp b/modules/botserv/botserv.cpp index c9172ba0e..85db067d2 100644 --- a/modules/botserv/botserv.cpp +++ b/modules/botserv/botserv.cpp @@ -57,12 +57,20 @@ public: BotInfo *bi = user->server == Me ? dynamic_cast(user) : NULL; if (bi && Config->GetModule(this)->Get("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;