diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:45:37 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:45:37 +0000 |
commit | f25c4b7a2263f5f3ce9bb41ba56b43c0d3a6d124 (patch) | |
tree | 43fba09e698269cd4c22c68be7ecb4a5875f55f3 /src/modules/m_spanningtree/protocolinterface.cpp | |
parent | 6e85701ecb09604f2c87010683638ec0446cc515 (diff) |
MetaData rework
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11607 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index 989e8b3e4..804a451ca 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -31,25 +31,19 @@ void SpanningTreeProtocolInterface::SendEncapsulatedData(parameterlist &encap) Utils->DoOneToMany(ServerInstance->Config->GetSID(), "ENCAP", encap); } -void SpanningTreeProtocolInterface::SendMetaData(void* target, TargetTypeFlags type, const std::string &key, const std::string &data) +void SpanningTreeProtocolInterface::SendMetaData(Extensible* target, const std::string &key, const std::string &data) { parameterlist params; - switch (type) - { - case TYPE_USER: - params.push_back(((User*)target)->uuid); - break; - case TYPE_CHANNEL: - params.push_back(((Channel*)target)->name); - break; - case TYPE_SERVER: - params.push_back("*"); - break; - default: - throw CoreException("I don't know how to handle TYPE_OTHER."); - break; - } + User* u = dynamic_cast<User*>(target); + Channel* c = dynamic_cast<Channel*>(target); + if (u) + params.push_back(u->uuid); + else if (c) + params.push_back(c->name); + else + params.push_back("*"); + params.push_back(key); params.push_back(":" + data); |