]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Only show UHNAMES and NAMESX in 005 if the cap module is loaded.
authorPeter Powell <petpow@saberuk.com>
Wed, 26 Jun 2019 18:02:51 +0000 (19:02 +0100)
committerPeter Powell <petpow@saberuk.com>
Wed, 26 Jun 2019 18:03:43 +0000 (19:03 +0100)
The legacy method of enabling these extensions is just a wrapper
around the capability. If the cap module is not loaded it can not
be enabled so we should not advertise it.

src/modules/m_namesx.cpp
src/modules/m_uhnames.cpp

index 2b4fd87b4daf50c87b209a9832500a122cc77509..d91b6b050224fcdbebbbc3a2ef5c7ec69820d42e 100644 (file)
@@ -48,7 +48,10 @@ class ModuleNamesX
 
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
-               tokens["NAMESX"];
+               // 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) CXX11_OVERRIDE
index 420ba2c846d7ecaa9276c16dfc62badf371c0d5d..3bf63a3553ee4159061bdb2a7a82997006be45f0 100644 (file)
@@ -44,7 +44,10 @@ class ModuleUHNames
 
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
        {
-               tokens["UHNAMES"];
+               // 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) CXX11_OVERRIDE