diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-09-02 13:17:24 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-09-13 12:15:44 +0200 |
commit | 02220d48eec4dd3507b582031de639c9d7835ec8 (patch) | |
tree | f74a09b5096b754b3484c3a03ee4d0fa91270c09 /src/modules/m_spanningtree/protocolinterface.cpp | |
parent | 58d7827bb1bd3d90f38a1c199f6f41ae9f24885c (diff) |
Split ProtocolInterface::SendMetaData() into multiple functions
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
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<User*>(target); - Channel* c = dynamic_cast<Channel*>(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) |