Added test code for one-to-many PRIVMSG

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1994 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2005-11-29 10:51:14 +00:00
parent 71d64b86a0
commit 8762141e13

View File

@ -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)