From 0e79977c1e1f468ee27ac9d0a3b81df8818fb4d3 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 21 Aug 2006 12:17:55 +0000 Subject: In 1.1, place all FJOIN parameters in the last parameter of the FJOIN - if there is more than one user joining, prefix with a colon. This way we're not limited to ~12 users per FJOIN command. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4988 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 11 ++++++++--- src/modules/m_swhois.cpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index fde13ef98..abd07d170 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1375,15 +1375,19 @@ class TreeSocket : public InspSocket ServerInstance->Log(DEBUG,"FJOIN detected, our TS=%lu, their TS=%lu",ourTS,TS); + irc::tokenstream users(params[2]); + std::string item = ""; + /* do this first, so our mode reversals are correctly received by other servers * if there is a TS collision. */ + params[2] = ":" + params[2]; DoOneToAllButSender(source,"FJOIN",params,source); - for (unsigned int usernum = 2; usernum < params.size(); usernum++) + while ((item = users.GetToken()) != "") { /* process one channel at a time, applying modes. */ - char* usr = (char*)params[usernum].c_str(); + char* usr = (char*)item.c_str(); /* Safety check just to make sure someones not sent us an FJOIN full of spaces * (is this even possible?) */ if (usr && *usr) @@ -1623,7 +1627,8 @@ class TreeSocket : public InspSocket n = "+"; } - size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s", n, i->second->nick); + // The first parameter gets a : before it + size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s%s", !numusers ? ":" : "", n, i->second->nick); curlen += ptrlen; ptr += ptrlen; diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index e98f87ffb..3103e7a56 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -28,7 +28,7 @@ class cmd_swhois : public command_t { public: - cmd_swhois (InspIRCd* Instance) : command_t(Instance,"SWHOIS",'o',2) + cmd_swhois (InspIRCd* Instance) : command_t(Instance,"SWHOIS",'o',2) { this->source = "m_swhois.so"; syntax = " "; -- cgit v1.2.3