summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-08-22 00:29:30 +0100
committerSadie Powell <sadie@witchery.services>2024-08-22 00:29:30 +0100
commita3edb09eda6da745b630c935c8e7a1188e9dade9 (patch)
treeac612bc16675765b74b9892cca6de724c9abfa05 /modules
parent27beb8f8777a9ab8e94408bd63328c0b57934118 (diff)
Use CanClearBans/SendClearBans when enforcing smartjoin.
Diffstat (limited to 'modules')
-rw-r--r--modules/botserv/botserv.cpp18
1 files 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<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;