diff options
author | Sadie Powell <sadie@witchery.services> | 2020-02-14 03:20:25 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-02-14 03:20:25 +0000 |
commit | 98b470674b740faf83507214a8d41f63eec279a5 (patch) | |
tree | 3ee9ea4db1a71a14b98681171ee834d98efd19df /src | |
parent | 8d5adb667fcdf05dc87b1091359b66ae7e12d090 (diff) |
Only register the sts capability when we have a valid config.
This avoids announcing a bare sts cap when the config is wrong.
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_ircv3_sts.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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 |