diff options
author | Peter Powell <petpow@saberuk.com> | 2019-06-26 19:02:51 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2019-06-26 19:03:43 +0100 |
commit | 3bd512df63f7fa81fcdad57b22ea4fc79fe56097 (patch) | |
tree | 7f7151222c3a8ccd430ea458567f7f5c856d659b | |
parent | 02beded762ccc71c7f87ec8bb32b8d614960ab90 (diff) |
Only show UHNAMES and NAMESX in 005 if the cap module is loaded.
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.
-rw-r--r-- | src/modules/m_namesx.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_uhnames.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index 2b4fd87b4..d91b6b050 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -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 diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp index 420ba2c84..3bf63a355 100644 --- a/src/modules/m_uhnames.cpp +++ b/src/modules/m_uhnames.cpp @@ -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 |