aboutsummaryrefslogtreecommitdiff
path: root/src/extensible.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-01-31 05:16:36 +0000
committerGravatar Sadie Powell2022-01-31 12:01:39 +0000
commit4cfc311591fb62c398b273ef2311a855c9fab3d9 (patch)
tree8f8cef41a093692c2dd7086b434ceea510789ab1 /src/extensible.cpp
parentUse more appropriate types in module-specific extension types. (diff)
Slim down the protocol interface for sending metadata.
Diffstat (limited to 'src/extensible.cpp')
-rw-r--r--src/extensible.cpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/extensible.cpp b/src/extensible.cpp
index 56760403f..0a72cfaca 100644
--- a/src/extensible.cpp
+++ b/src/extensible.cpp
@@ -135,23 +135,8 @@ void* ExtensionItem::UnsetRaw(Extensible* container)
void ExtensionItem::Sync(const Extensible* container, void* item)
{
const std::string networkstr = ToNetwork(container, item);
- if (networkstr.empty())
- return;
-
- switch (extype)
- {
- case ExtensionType::CHANNEL:
- ServerInstance->PI->SendMetaData(static_cast<const Channel*>(container), name, networkstr);
- break;
-
- case ExtensionType::MEMBERSHIP:
- ServerInstance->PI->SendMetaData(static_cast<const Membership*>(container), name, networkstr);
- break;
-
- case ExtensionType::USER:
- ServerInstance->PI->SendMetaData(static_cast<const User*>(container), name, networkstr);
- break;
- }
+ if (!networkstr.empty())
+ ServerInstance->PI->SendMetaData(container, name, networkstr);
}
void ExtensionItem::FromInternal(Extensible* container, const std::string& value) noexcept