From 0ed3ef9dee2cb8f4b0c37da218a2fd1eee8c31f6 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 13 Sep 2009 20:32:03 +0000 Subject: Add SerializeFormat for easier metadata formatting git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11704 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 11 ----------- src/modules/m_spanningtree/main.h | 1 - src/modules/m_spanningtree/netburst.cpp | 4 ++-- 3 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 3877daf42..ee8c82c8b 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -932,17 +932,6 @@ void ModuleSpanningTree::ProtoSendMetaData(void* opaque, Extensible* target, con s->WriteLine(std::string(":")+ServerInstance->Config->GetSID()+" METADATA * "+extname+" :"+extdata); } -std::string ModuleSpanningTree::ProtoTranslate(Extensible* item) -{ - User* u = dynamic_cast(item); - Channel* c = dynamic_cast(item); - if (u) - return u->uuid; - if (c) - return c->name; - return "*"; -} - void ModuleSpanningTree::OnEvent(Event* event) { if ((event->GetEventID() == "send_encap") || (event->GetEventID() == "send_metadata") || (event->GetEventID() == "send_topic") || (event->GetEventID() == "send_mode") || (event->GetEventID() == "send_mode_explicit") || (event->GetEventID() == "send_opers") diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 1d3ec9d39..0144eb4a3 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -187,7 +187,6 @@ class ModuleSpanningTree : public Module ModResult OnSetAway(User* user, const std::string &awaymsg); void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector &modeline, const std::vector &translate); void ProtoSendMetaData(void* opaque, Extensible* target, const std::string &extname, const std::string &extdata); - std::string ProtoTranslate(Extensible* item); void OnEvent(Event* event); void OnLoadModule(Module* mod,const std::string &name); void OnUnloadModule(Module* mod,const std::string &name); diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 3ed85ea1e..ada10e6a1 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -225,7 +225,7 @@ void TreeSocket::SendChannelModes(TreeServer* Current) ExtensionItem* item = Extensible::GetItem(i->first); std::string value; if (item) - value = item->serialize(Utils->Creator, c->second, i->second); + value = item->serialize(FORMAT_NETWORK, c->second, i->second); if (!value.empty()) Utils->Creator->ProtoSendMetaData(this, c->second, i->first, value); } @@ -276,7 +276,7 @@ void TreeSocket::SendUsers(TreeServer* Current) ExtensionItem* item = Extensible::GetItem(i->first); std::string value; if (item) - value = item->serialize(Utils->Creator, u->second, i->second); + value = item->serialize(FORMAT_NETWORK, u->second, i->second); if (!value.empty()) Utils->Creator->ProtoSendMetaData(this, u->second, i->first, value); } -- cgit v1.2.3