From 02220d48eec4dd3507b582031de639c9d7835ec8 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 2 Sep 2013 13:17:24 +0200 Subject: Split ProtocolInterface::SendMetaData() into multiple functions --- src/modules/m_spanningtree/protocolinterface.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/modules/m_spanningtree/protocolinterface.cpp') diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 013dfac1b..cc015ff4a 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -56,16 +56,19 @@ bool SpanningTreeProtocolInterface::SendEncapsulatedData(const parameterlist &en return params.Unicast(encap[0]); } -void SpanningTreeProtocolInterface::SendMetaData(Extensible* target, const std::string &key, const std::string &data) +void SpanningTreeProtocolInterface::SendMetaData(User* u, const std::string& key, const std::string& data) { - User* u = dynamic_cast(target); - Channel* c = dynamic_cast(target); - if (u) - CommandMetadata::Builder(u, key, data).Broadcast(); - else if (c) - CommandMetadata::Builder(c, key, data).Broadcast(); - else - CommandMetadata::Builder(key, data).Broadcast(); + CommandMetadata::Builder(u, key, data).Broadcast(); +} + +void SpanningTreeProtocolInterface::SendMetaData(Channel* c, const std::string& key, const std::string& data) +{ + CommandMetadata::Builder(c, key, data).Broadcast(); +} + +void SpanningTreeProtocolInterface::SendMetaData(const std::string& key, const std::string& data) +{ + CommandMetadata::Builder(key, data).Broadcast(); } void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &topic) -- cgit v1.2.3