From 1099db23d74c10e8c78760d9e6e99605bc2c373a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 16 Jul 2021 18:42:19 +0100 Subject: [PATCH] Drop support for the legacy PROTOCTL extension. People who wish to keep this behavious should install the protoctl module from inspircd-contrib. --- docs/conf/modules.conf.example | 7 +++---- src/modules/m_namesx.cpp | 31 +------------------------------ src/modules/m_uhnames.cpp | 31 +------------------------------ 3 files changed, 5 insertions(+), 64 deletions(-) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 4f63298a6..e867da69c 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1421,8 +1421,7 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # NAMESX module: Provides support for the IRCv3 multi-prefix capability -# and legacy NAMESX extension which allow clients to see all the prefix -# modes set on a user. +# which allows clients to see all the prefix modes set on a user. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -2312,8 +2311,8 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # UHNAMES support module: Adds support for the IRCv3 userhost-in-names -# capability and legacy UHNAMES extension which display the ident and -# hostname of users in the NAMES list. +# capability which displays the ident and hostname of users in the NAMES +# list. # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index fed1a00c7..60bbbe813 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -25,14 +25,12 @@ #include "inspircd.h" #include "modules/cap.h" -#include "modules/isupport.h" #include "modules/names.h" #include "modules/who.h" #include "modules/whois.h" -class ModuleNamesX +class ModuleNamesX final : public Module - , public ISupport::EventListener , public Names::EventListener , public Who::EventListener , public Whois::LineEventListener @@ -43,7 +41,6 @@ class ModuleNamesX public: ModuleNamesX() : Module(VF_VENDOR, "Provides the IRCv3 multi-prefix client capability.") - , ISupport::EventListener(this) , Names::EventListener(this) , Who::EventListener(this) , Whois::LineEventListener(this) @@ -51,32 +48,6 @@ class ModuleNamesX { } - void OnBuildISupport(ISupport::TokenMap& tokens) override - { - // The legacy PROTOCTL system is a wrapper around the cap. - dynamic_reference_nocheck capmanager(this, "capmanager"); - if (capmanager) - tokens["NAMESX"]; - } - - ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override - { - /* We don't actually create a proper command handler class for PROTOCTL, - * because other modules might want to have PROTOCTL hooks too. - * Therefore, we just hook its as an unvalidated command therefore we - * can capture it even if it doesnt exist! :-) - */ - if (command == "PROTOCTL") - { - if (!parameters.empty() && irc::equals(parameters[0], "NAMESX")) - { - cap.Set(user, true); - return MOD_RES_DENY; - } - } - return MOD_RES_PASSTHRU; - } - ModResult OnNamesListItem(LocalUser* issuer, Membership* memb, std::string& prefixes, std::string& nick) override { if (cap.IsEnabled(issuer)) diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp index 8c2ab9a51..7aa12c34b 100644 --- a/src/modules/m_uhnames.cpp +++ b/src/modules/m_uhnames.cpp @@ -25,12 +25,10 @@ #include "inspircd.h" #include "modules/cap.h" -#include "modules/isupport.h" #include "modules/names.h" -class ModuleUHNames +class ModuleUHNames final : public Module - , public ISupport::EventListener , public Names::EventListener { private: @@ -39,38 +37,11 @@ class ModuleUHNames public: ModuleUHNames() : Module(VF_VENDOR, "Provides the IRCv3 userhost-in-names client capability.") - , ISupport::EventListener(this) , Names::EventListener(this) , cap(this, "userhost-in-names") { } - void OnBuildISupport(ISupport::TokenMap& tokens) override - { - // The legacy PROTOCTL system is a wrapper around the cap. - dynamic_reference_nocheck capmanager(this, "capmanager"); - if (capmanager) - tokens["UHNAMES"]; - } - - ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override - { - /* We don't actually create a proper command handler class for PROTOCTL, - * because other modules might want to have PROTOCTL hooks too. - * Therefore, we just hook its as an unvalidated command therefore we - * can capture it even if it doesnt exist! :-) - */ - if (command == "PROTOCTL") - { - if (!parameters.empty() && irc::equals(parameters[0], "UHNAMES")) - { - cap.Set(user, true); - return MOD_RES_DENY; - } - } - return MOD_RES_PASSTHRU; - } - ModResult OnNamesListItem(LocalUser* issuer, Membership* memb, std::string& prefixes, std::string& nick) override { if (cap.IsEnabled(issuer))