mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Drop support for the legacy PROTOCTL extension.
People who wish to keep this behavious should install the protoctl module from inspircd-contrib.
This commit is contained in:
parent
fcc7b7cdb4
commit
1099db23d7
@ -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.
|
||||
#<module name="namesx">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
@ -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.
|
||||
#<module name="uhnames">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
|
@ -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<Cap::Manager> 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))
|
||||
|
@ -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<Cap::Manager> 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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user