diff options
| author | 2014-01-26 13:12:01 +0100 | |
|---|---|---|
| committer | 2014-01-26 13:12:01 +0100 | |
| commit | 3fef0ed889eecb40b96a597924254560c81d4a09 (patch) | |
| tree | 78f1d41e26cd2b9f9a91442ef9ccc78683bad315 /src/modules/m_spanningtree/protocolinterface.cpp | |
| parent | ProtocolInterface::SendEncapsulatedData() changes (diff) | |
Add ProtocolInterface::BroadcastEncap() and infrastructure for manually forwarding ENCAPs
Diffstat (limited to 'src/modules/m_spanningtree/protocolinterface.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index ee5e31984..192f7cff2 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -71,6 +71,17 @@ bool SpanningTreeProtocolInterface::SendEncapsulatedData(const std::string& targ return true; } +void SpanningTreeProtocolInterface::BroadcastEncap(const std::string& cmd, const parameterlist& params, User* source, User* omit) +{ + if (!source) + source = ServerInstance->FakeClient; + + // If omit is non-NULL we pass the route belonging to the user to Forward(), + // otherwise we pass NULL, which is equivalent to Broadcast() + TreeServer* server = (omit ? TreeServer::Get(omit)->GetRoute() : NULL); + CmdBuilder(source, "ENCAP * ").push_raw(cmd).insert(params).Forward(server); +} + void SpanningTreeProtocolInterface::SendMetaData(User* u, const std::string& key, const std::string& data) { CommandMetadata::Builder(u, key, data).Broadcast(); |
