From cd614831dea507de6bdb2a2d1143b8373603f9e8 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 8 Mar 2024 16:41:02 +0000 Subject: Fix feature detection on InspIRCd. --- modules/protocol/inspircd3.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/protocol/inspircd3.cpp b/modules/protocol/inspircd3.cpp index 9c11f98c5..8a1b77690 100644 --- a/modules/protocol/inspircd3.cpp +++ b/modules/protocol/inspircd3.cpp @@ -66,9 +66,7 @@ class InspIRCd3Proto : public IRCDProto CanSetVHost = true; CanSetVIdent = true; CanSQLine = true; - CanSQLineChannel = true; CanSZLine = true; - CanSVSHold = true; CanCertFP = true; RequiresID = true; MaxModes = 20; @@ -931,8 +929,7 @@ struct IRCDMessageCapab : Message::Capab } /* reset CAPAB */ - Servers::Capab.insert("SERVERS"); - Servers::Capab.insert("TOPICLOCK"); + Servers::Capab.clear(); IRCD->CanSQLineChannel = false; IRCD->CanSVSHold = false; IRCD->DefaultPseudoclientModes = "+oI"; @@ -1238,11 +1235,15 @@ struct IRCDMessageCapab : Message::Capab return; } if (!IRCD->CanSVSHold) - Log() << "SVSHOLD missing, Usage disabled until module is loaded."; + Log() << "The remote server does not have the svshold module; fake users will be used for nick protection until the module is loaded."; + if (!IRCD->CanSQLineChannel) + Log() << "The remote server does not have the cban module; services will manually enforce forbidden channels until the module is loaded."; if (!Servers::Capab.count("CHGHOST")) - Log() << "CHGHOST missing, Usage disabled until module is loaded."; + Log() << "The remote server does not have the chghost module; vhosts are disabled until the module is loaded."; if (!Servers::Capab.count("CHGIDENT")) - Log() << "CHGIDENT missing, Usage disabled until module is loaded."; + Log() << "The remote server does not have the chgident module; vidents are disabled until the module is loaded."; + if (!Servers::Capab.count("GLOBOPS")) + Log() << "The remote server does not have the globops module; oper notices will be sent as announcements until the module is loaded."; } Message::Capab::Run(source, params); @@ -1484,12 +1485,16 @@ class IRCDMessageMetadata : IRCDMessage required = true; else if (module.equals_cs("m_hidechans.so")) required = true; + else if (module.equals_cs("m_cban.so=glob") && plus) + IRCD->CanSQLineChannel = true; + if (module.equals_cs("m_cban.so") && !plus) + IRCD->CanSQLineChannel = false; else if (module.equals_cs("m_chghost.so")) capab = "CHGHOST"; else if (module.equals_cs("m_chgident.so")) capab = "CHGIDENT"; else if (module.equals_cs("m_svshold.so")) - capab = "SVSHOLD"; + IRCD->CanSVSHold = plus; else if (module.equals_cs("m_rline.so")) capab = "RLINE"; else if (module.equals_cs("m_topiclock.so")) @@ -1504,9 +1509,9 @@ class IRCDMessageMetadata : IRCDMessage } else { - if (plus) + if (plus && !capab.empty()) Servers::Capab.insert(capab); - else + else if (!capab.empty()) Servers::Capab.erase(capab); Log() << "InspIRCd " << (plus ? "loaded" : "unloaded") << " module " << module << ", adjusted functionality"; -- cgit