From 94b92f6ea5be0ed5939ea705ba3cec2cf54dbe9a Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 25 Sep 2006 17:09:19 +0000 Subject: Add send_topic event, lets you send a topic for a channel, set by a server (internally this translates as FTOPIC in this protocol) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5322 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 77d09ae3e..2651b4f90 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -4821,17 +4821,26 @@ class ModuleSpanningTree : public Module virtual void OnEvent(Event* event) { + std::deque* params = (std::deque*)event->GetData(); + if (event->GetEventID() == "send_metadata") { - std::deque* params = (std::deque*)event->GetData(); if (params->size() < 3) return; (*params)[2] = ":" + (*params)[2]; DoOneToMany(ServerInstance->Config->ServerName,"METADATA",*params); } + else if (event->GetEventID() == "send_topic") + { + if (params->size() < 2) + return; + (*params)[1] = ":" + (*params)[1]; + params->insert(params->begin() + 1,ServerInstance->Config->ServerName); + params->insert(params->begin() + 1,ConvToStr(ServerInstance->Time())); + DoOneToMany(ServerInstance->Config->ServerName,"FTOPIC",*params); + } else if (event->GetEventID() == "send_mode") { - std::deque* params = (std::deque*)event->GetData(); if (params->size() < 2) return; // Insert the TS value of the object, either userrec or chanrec -- cgit v1.2.3