summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 10:51:14 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-29 10:51:14 +0000
commit8762141e131391b9fcd5641788735e155ffbe5b5 (patch)
treeeca4038be1fce8c4519376ae85958135d6214581 /src/modules/m_spanningtree.cpp
parent71d64b86a075acb49e297701035ea196efa11f8f (diff)
Added test code for one-to-many PRIVMSG
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1994 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree.cpp')
-rw-r--r--src/modules/m_spanningtree.cpp26
1 files changed, 26 insertions, 0 deletions
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<std::string> params;
+ std::vector<std::string> wlist;
+ params.clear();
+ wlist.clear();
+ params.push_back(c->name);
+ params.push_back(":"+text);
+ std::vector<char*> *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)