summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/protocolinterface.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-09-02 13:17:24 +0200
committerattilamolnar <attilamolnar@hush.com>2013-09-13 12:15:44 +0200
commit02220d48eec4dd3507b582031de639c9d7835ec8 (patch)
treef74a09b5096b754b3484c3a03ee4d0fa91270c09 /src/modules/m_spanningtree/protocolinterface.cpp
parent58d7827bb1bd3d90f38a1c199f6f41ae9f24885c (diff)
Split ProtocolInterface::SendMetaData() into multiple functions
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r--src/modules/m_spanningtree/protocolinterface.cpp21
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)