From 5b44291dc24c4e1d5c427e355aa07d91c64522e1 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 11 May 2026 15:50:34 +0100 Subject: Fix the unauthed extban not having its negated form documented. --- docs/conf/help.example.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/conf/help.example.conf b/docs/conf/help.example.conf index 68b8b1efa..3c5dd408d 100644 --- a/docs/conf/help.example.conf +++ b/docs/conf/help.example.conf @@ -1159,8 +1159,8 @@ Matching extbans: [!]share: Matches users that are banned from . This extban requires the [!]b: sharebans module. -unauthed: Matches users that have a nick!user@host mask matching . This -U: extban requires the account module. +[!]unauthed: Matches users that have a nick!user@host mask matching . This +[!]U: extban requires the account module. Acting extbans: -- cgit v1.3.1-10-gc9f91 From 2e5c1034be583c0a0564890f1170f92568fd1795 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 11 May 2026 15:51:31 +0100 Subject: Add the bot extended ban. --- docs/conf/help.example.conf | 3 +++ docs/conf/modules.example.conf | 10 ++++++++++ src/modules/m_botmode.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+) (limited to 'docs') diff --git a/docs/conf/help.example.conf b/docs/conf/help.example.conf index 3c5dd408d..de4e304b6 100644 --- a/docs/conf/help.example.conf +++ b/docs/conf/help.example.conf @@ -1119,6 +1119,9 @@ Matching extbans: [!]R: has sent the owned nicknames to the IRCd this will also match against all owned nicknames. This extban requires the account module. +[!]bot: Matches bots that have a nick!user@host mask matching . This +[!]B: extban requires the botmode module. + [!]channel: Matches users that have on a channel matching . This [!]j: extban requires the channelban module. diff --git a/docs/conf/modules.example.conf b/docs/conf/modules.example.conf index 3651655da..6d5e2da1d 100644 --- a/docs/conf/modules.example.conf +++ b/docs/conf/modules.example.conf @@ -258,6 +258,16 @@ # Botmode module: Adds the user mode +B. If set on a user, it will # show that the user is a bot in /WHOIS. # +# +#-#-#-#-#-#-#-#-#-#-#-# BOTMODE CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-#-# +# extban - Whether extended ban B: (bot) is enabled. This extban # +# matches against the ban mask of users with user mode # +# +B (bot) set. Defaults to no. # +# # +# forcenotice - Whether to force all messages sent by bots to use a # +# notice. Defaults to no. # +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # CallerID module: Adds user mode +g which activates hybrid-style diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index c56907603..3fb9a3cf1 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -23,10 +23,32 @@ #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(Module* Creator, SimpleUserMode& bm) + : ExtBan::MatchingBase(Creator, "bot", 'B') + , botmode(bm) + { + if (!ServerInstance->Config->ConfValue("botmode")->getBool("extban")) + DisableAutoRegister(); + } + + bool IsMatch(User* user, Channel* channel, const std::string& text) override + { + return user->IsModeSet(botmode) && channel->CheckBan(user, text); + } +}; + class BotTag final : public CTCTags::TagProvider { @@ -56,6 +78,7 @@ class ModuleBotMode final { private: SimpleUserMode bm; + BotExtBan extban; BotTag tag; bool forcenotice; @@ -66,6 +89,7 @@ public: , Who::EventListener(this) , Whois::EventListener(this) , bm(this, "bot", 'B') + , extban(this, bm) , tag(this, bm) { } -- cgit v1.3.1-10-gc9f91