diff options
| author | 2026-05-11 15:55:06 +0100 | |
|---|---|---|
| committer | 2026-05-11 16:02:45 +0100 | |
| commit | 9ffa06613bf56e14767bb3209f2b39dc5d28db56 (patch) | |
| tree | 9a64261fb0e4cd6d96bc93d91019454226d6687f /modules/botmode.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
| parent | Add the bot extended ban. (diff) | |
Merge branch 'insp4' into master.
Diffstat (limited to 'modules/botmode.cpp')
| -rw-r--r-- | modules/botmode.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/botmode.cpp b/modules/botmode.cpp index f9d39e10d..95820db2e 100644 --- a/modules/botmode.cpp +++ b/modules/botmode.cpp @@ -23,10 +23,30 @@ #include "inspircd.h" #include "modules/ctctags.h" +#include "modules/extban.h" #include "modules/isupport.h" #include "modules/who.h" #include "modules/whois.h" +class BotExtBan final + : public ExtBan::MatchingBase +{ +private: + SimpleUserMode& botmode; + +public: + BotExtBan(const WeakModulePtr& mod, SimpleUserMode& bm) + : ExtBan::MatchingBase(mod, "bot", 'B') + , botmode(bm) + { + } + + bool IsMatch(ListModeBase* lm, User* user, Channel* channel, const std::string& text, const ExtBan::MatchConfig& config) override + { + return user->IsModeSet(botmode) && config.next_match(lm, user, channel, text, config); + } +}; + class BotTag final : public CTCTags::TagProvider { @@ -56,6 +76,7 @@ class ModuleBotMode final { private: SimpleUserMode bm; + BotExtBan extban; BotTag tag; bool forcenotice; @@ -66,6 +87,7 @@ public: , Who::EventListener(weak_from_this()) , Whois::EventListener(weak_from_this()) , bm(weak_from_this(), "bot", 'B') + , extban(weak_from_this(), bm) , tag(weak_from_this(), bm) { } |
