From ccea6c12cd10e26c3ccacc91fdc16897d00582de Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 4 Apr 2008 20:47:45 +0000 Subject: See this brain git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9336 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/netburst.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index 75f9b8e5b..c61211ff9 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -86,8 +86,9 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) size_t dlen, curlen; dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu +%s",this->Instance->Config->GetSID().c_str(),c->name,(unsigned long)c->age, c->ChanModes(true)); - int numusers = 1; + int numusers = 0; char* ptr = list + dlen; + bool looped_once = false; CUList *ulist = c->GetUsers(); std::string modes; @@ -98,6 +99,8 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) // The first parameter gets a : before it size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", this->Instance->Modes->ModeString(i->first, c, false).c_str(), i->first->uuid); + looped_once = true; + curlen += ptrlen; ptr += ptrlen; @@ -113,7 +116,9 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) } } - if (numusers) + // Okay, permanent channels will (of course) need this \r\n anyway, numusers check is if there + // actually were people in the channel (looped_once == true) + if (!looped_once || numusers > 0) buffer.append(list).append("\r\n"); int linesize = 1; -- cgit v1.2.3