summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-10-04 11:20:19 +0100
committerSadie Powell <sadie@witchery.services>2024-10-04 11:20:19 +0100
commit9b188a6c048a93497c1b2fb3797d69c083578fdd (patch)
treee3a1316677e9c35439afec751fd4d9bb4c93cc7a /modules
parent2f745132461080b4773e878d0cafb68de99a7e67 (diff)
Respect EXTBANFORMAT on InspIRCd v4.
Diffstat (limited to 'modules')
-rw-r--r--modules/protocol/inspircd.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp
index 00ed2bf49..64a712498 100644
--- a/modules/protocol/inspircd.cpp
+++ b/modules/protocol/inspircd.cpp
@@ -27,6 +27,9 @@ struct SASLUser final
namespace
{
+ /** Whether we should send extbans using their named form. */
+ bool named_extbans = false;
+
// The SID of a server we are waiting to squit.
Anope::string rsquit_id;
@@ -723,7 +726,8 @@ namespace InspIRCdExtBan
ChannelMode *Wrap(Anope::string &param) override
{
- param = Anope::string(xbchar) + ":" + param;
+ auto xbprefix = named_extbans ? xbname : Anope::string(xbchar);
+ param = xbprefix + ":" + param;
return ChannelModeVirtual<ChannelModeList>::Wrap(param);
}
@@ -1573,6 +1577,8 @@ struct IRCDMessageCapab final
auto [tokname, tokvalue] = ParseCapability(capab);
if (tokname == "CHALLENGE")
challenge = tokvalue;
+ if (tokname == "EXTBANFORMAT")
+ named_extbans = tokvalue.equals_ci("any") || tokvalue.equals_ci("name");
else if (tokname == "MAXCHANNEL")
IRCD->MaxChannel = Anope::Convert<size_t>(tokvalue, IRCD->MaxChannel);
else if (tokname == "MAXHOST")