From 98b470674b740faf83507214a8d41f63eec279a5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 14 Feb 2020 03:20:25 +0000 Subject: Only register the sts capability when we have a valid config. This avoids announcing a bare sts cap when the config is wrong. --- src/modules/m_ircv3_sts.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/modules/m_ircv3_sts.cpp b/src/modules/m_ircv3_sts.cpp index a46322a87..86ea159c1 100644 --- a/src/modules/m_ircv3_sts.cpp +++ b/src/modules/m_ircv3_sts.cpp @@ -70,6 +70,7 @@ class STSCap : public Cap::Capability STSCap(Module* mod) : Cap::Capability(mod, "sts") { + DisableAutoRegister(); } ~STSCap() @@ -173,6 +174,9 @@ class ModuleIRCv3STS : public Module unsigned long duration = tag->getDuration("duration", 60*60*24*30*2); bool preload = tag->getBool("preload"); cap.SetPolicy(host, duration, port, preload); + + if (!cap.IsRegistered()) + ServerInstance->Modules->AddService(cap); } Version GetVersion() CXX11_OVERRIDE -- cgit v1.2.3