*/
virtual bool SendEncapsulatedData(const parameterlist &encap) { return false; }
- /** Send metadata for an object to other linked servers.
- * @param target The object to send metadata for.
+ /** Send metadata for a channel to other linked servers.
+ * @param chan The channel to send metadata for
* @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user
* @param data The string representation of the data
*/
- virtual void SendMetaData(Extensible* target, const std::string &key, const std::string &data) { }
+ virtual void SendMetaData(Channel* chan, const std::string& key, const std::string& data) { }
+
+ /** Send metadata for a user to other linked servers.
+ * @param user The user to send metadata for
+ * @param key The 'key' of the data, e.g. "swhois" for swhois desc on a user
+ * @param data The string representation of the data
+ */
+ virtual void SendMetaData(User* user, const std::string& key, const std::string& data) { }
+
+ /** Send metadata related to the server to other linked servers.
+ * @param key The 'key' of the data
+ * @param data The string representation of the data
+ */
+ virtual void SendMetaData(const std::string& key, const std::string& data) { }
/** Send a topic change for a channel
* @param channel The channel to change the topic for.
data.push_back('=');
data.append(v.link_data);
}
- ServerInstance->PI->SendMetaData(NULL, "modules", data);
+ ServerInstance->PI->SendMetaData("modules", data);
}
void ModuleSpanningTree::OnUnloadModule(Module* mod)
{
if (!Utils)
return;
- ServerInstance->PI->SendMetaData(NULL, "modules", "-" + mod->ModuleSourceFile);
+ ServerInstance->PI->SendMetaData("modules", "-" + mod->ModuleSourceFile);
// Close all connections which use an IO hook provided by this module
const TreeServer::ChildServers& list = Utils->TreeRoot->GetChildren();
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)
{
public:
bool SendEncapsulatedData(const parameterlist &encap);
- void SendMetaData(Extensible* target, const std::string &key, const std::string &data);
+ void SendMetaData(User* user, const std::string& key, const std::string& data) CXX11_OVERRIDE;
+ void SendMetaData(Channel* chan, const std::string& key, const std::string& data) CXX11_OVERRIDE;
+ void SendMetaData(const std::string& key, const std::string& data) CXX11_OVERRIDE;
void SendTopic(Channel* channel, std::string &topic);
void SendMode(User* source, User* usertarget, Channel* chantarget, const parameterlist& modedata, const std::vector<TranslateType>& types);
void SendSNONotice(const std::string &snomask, const std::string &text);