]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/protocolinterface.cpp
Merge pull request #708 from SaberUK/master+development-branch
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / protocolinterface.cpp
index 013dfac1b2405a35c28b4b1876139e50a6640e44..a6c826c7bf0c763cdc4006206099c01658e789d6 100644 (file)
@@ -56,16 +56,24 @@ 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::Server::SendMetaData(const std::string& key, const std::string& data)
+{
+       sock->WriteLine(CommandMetadata::Builder(key, data));
 }
 
 void SpanningTreeProtocolInterface::SendTopic(Channel* channel, std::string &topic)