summaryrefslogtreecommitdiff
path: root/modules/botserv/botserv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/botserv/botserv.cpp')
-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;