diff options
| author | 2021-03-17 16:07:33 +0000 | |
|---|---|---|
| committer | 2021-03-17 21:13:10 +0000 | |
| commit | a4e9ebfda34afcf6eb7602381c2f9313ab1b8b78 (patch) | |
| tree | 4f3884cc3415e3c7ef3ce4ebf30150a1dd166e20 /src/modules | |
| parent | Move extensible code from base.cpp to extensible.cpp and cleanup. (diff) | |
Implement support for automatically syncing extension items.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_customtitle.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_dccallow.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_silence.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_sslinfo.cpp | 7 | ||||
| -rw-r--r-- | src/modules/m_swhois.cpp | 10 |
5 files changed, 7 insertions, 16 deletions
diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 0f7f2fdf0..14f4bc21f 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -90,8 +90,6 @@ class CommandTitle : public Command { ctitle.Set(user, config.title); - ServerInstance->PI->SendMetaData(user, "ctitle", config.title); - if (!config.vhost.empty()) user->ChangeDisplayedHost(config.vhost); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index b2f9d644b..4c09063b6 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -122,7 +122,7 @@ class DCCAllowExt : public SimpleExtItem<dccallowlist> return; // Remove the old list and create a new one. - Unset(user); + Unset(user, false); dccallowlist* list = new dccallowlist(); irc::spacesepstream ts(value); diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index b670182d4..edc81be40 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -201,7 +201,7 @@ class SilenceExtItem : public SimpleExtItem<SilenceList> return; // Remove the old list and create a new one. - Unset(user); + Unset(user, false); SilenceList* list = new SilenceList(); irc::spacesepstream ts(value); diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp index e08a11e03..8537c57e9 100644 --- a/src/modules/m_sslinfo.cpp +++ b/src/modules/m_sslinfo.cpp @@ -53,12 +53,15 @@ class SSLCertExt : public ExtensionItem return static_cast<ssl_cert*>(GetRaw(item)); } - void Set(Extensible* item, ssl_cert* value) + void Set(Extensible* item, ssl_cert* value, bool sync = true) { value->refcount_inc(); ssl_cert* old = static_cast<ssl_cert*>(SetRaw(item, value)); if (old && old->refcount_dec()) delete old; + + if (sync) + Sync(item, value); } void Unset(Extensible* container) @@ -74,7 +77,7 @@ class SSLCertExt : public ExtensionItem void FromNetwork(Extensible* container, const std::string& value) noexcept override { ssl_cert* cert = new ssl_cert; - Set(container, cert); + Set(container, cert, false); std::stringstream s(value); std::string v; diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 2b14def9d..562c4a312 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -80,14 +80,6 @@ class CommandSwhois : public Command else swhois.Set(dest, parameters[1]); - /* Bug #376 - feature request - - * To cut down on the amount of commands services etc have to recognise, this only sends METADATA across the network now - * not an actual SWHOIS command. Any SWHOIS command sent from services will be automatically translated to METADATA by this. - * Sorry w00t i know this was your fix, but i got bored and wanted to clear down the tracker :) - * -- Brain - */ - ServerInstance->PI->SendMetaData(dest, "swhois", parameters[1]); - return CmdResult::SUCCESS; } @@ -138,7 +130,6 @@ class ModuleSWhois cmd.operblock.Set(user, 1); cmd.swhois.Set(user, swhois); - ServerInstance->PI->SendMetaData(user, "swhois", swhois); } void OnPostDeoper(User* user) override @@ -152,7 +143,6 @@ class ModuleSWhois cmd.operblock.Unset(user); cmd.swhois.Unset(user); - ServerInstance->PI->SendMetaData(user, "swhois", ""); } void OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string&) override |
