diff options
| author | 2014-06-11 14:37:42 +0200 | |
|---|---|---|
| committer | 2014-06-11 14:37:42 +0200 | |
| commit | ce82bc069d42b0eb1076ddc4c3ec94db415c3eb0 (patch) | |
| tree | 6b13fd5651de3f09d13b6f10556751e2fb60c258 /src/modules/m_spanningtree/netburst.cpp | |
| parent | m_spanningtree Send, parse and translate IJOINs with membership ids (diff) | |
| download | inspircd++-ce82bc069d42b0eb1076ddc4c3ec94db415c3eb0.tar.gz inspircd++-ce82bc069d42b0eb1076ddc4c3ec94db415c3eb0.tar.bz2 inspircd++-ce82bc069d42b0eb1076ddc4c3ec94db415c3eb0.zip | |
m_spanningtree Add CmdBuilder specialization for FJOIN
Diffstat (limited to 'src/modules/m_spanningtree/netburst.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/netburst.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/modules/m_spanningtree/netburst.cpp b/src/modules/m_spanningtree/netburst.cpp index a33cf8a13..093ab89eb 100644 --- a/src/modules/m_spanningtree/netburst.cpp +++ b/src/modules/m_spanningtree/netburst.cpp @@ -159,25 +159,21 @@ void TreeSocket::SendServers(TreeServer* Current, TreeServer* s) */ void TreeSocket::SendFJoins(Channel* c) { - std::string line(":"); - line.append(ServerInstance->Config->GetSID()).append(" FJOIN ").append(c->name).append(1, ' ').append(ConvToStr(c->age)).append(" +"); - std::string::size_type erase_from = line.length(); - line.append(c->ChanModes(true)).append(" :"); - + CommandFJoin::Builder fjoin(c); const UserMembList *ulist = c->GetUsers(); for (UserMembCIter i = ulist->begin(); i != ulist->end(); ++i) { - const std::string& modestr = i->second->modes; - if ((line.length() + modestr.length() + UIDGenerator::UUID_LENGTH + 2) > 480) + Membership* memb = i->second; + if (!fjoin.has_room(memb)) { - this->WriteLine(line); - line.erase(erase_from); - line.append(" :"); + // No room for this user, send the line and prepare a new one + this->WriteLine(fjoin.finalize()); + fjoin.clear(); } - line.append(modestr).append(1, ',').append(i->first->uuid).push_back(' '); + fjoin.add(memb); } - this->WriteLine(line); + this->WriteLine(fjoin.finalize()); } /** Send all XLines we know about */ |
