From 8762141e131391b9fcd5641788735e155ffbe5b5 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 29 Nov 2005 10:51:14 +0000 Subject: Added test code for one-to-many PRIVMSG git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1994 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 243e3dce2..9462b5252 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1225,6 +1225,32 @@ class ModuleSpanningTree : public Module DoOneToOne(user->nick,"PRIVMSG",params,d->server); } } + else + { + chanrec* c = (chanrec*)dest; + std::deque params; + std::vector wlist; + params.clear(); + wlist.clear(); + params.push_back(c->name); + params.push_back(":"+text); + std::vector *ulist = c->GetUsers(); + for (unsigned int j = 0; j < ulist->size(); j++) + { + char* o = (*ulist)[j]; + userrec* otheruser = (userrec*)o; + if (!strcasecmp(otheruser->server,Srv->GetServerName().c_str())) + { + // this user is on another server. + // Write that server, then mark that server so we dont write to it again. + if (find(wlist.begin(),wlist.end(),otheruser->server) == wlist.end()) + { + DoOneToOne(user->nick,"PRIVMSG",params,otheruser->server); + wlist.push_back(otheruser->server); + } + } + } + } } virtual void OnUserJoin(userrec* user, chanrec* channel) -- cgit v1.2.3