From fd97ca43bbe87959e58f3f47bcb338b7b3a4f3f5 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 22 Oct 2006 13:38:06 +0000 Subject: Fix sending bans on sync: * Dont cram them after +jfJLlk parameters * Limit them to MAXMODES per line git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5514 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree.cpp') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 155ad7099..9c41abee1 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1914,9 +1914,19 @@ class TreeSocket : public InspSocket for (BanList::iterator b = c->bans.begin(); b != c->bans.end(); b++) { modes.append("b"); - params.append(b->data).append(" "); + params.append(" ").append(b->data); + if (params.length() >= MAXMODES) + { + /* Wrap at MAXMODES */ + this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" FMODE "+c->name+" "+ConvToStr(c->age)+" +"+modes+params); + modes = ""; + params = ""; + } } - this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" FMODE "+c->name+" "+ConvToStr(c->age)+" +"+c->ChanModes(true)+modes+" "+params); + this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" FMODE "+c->name+" "+ConvToStr(c->age)+" +"+c->ChanModes(true)); + /* Only send these if there are any */ + if (!modes.empty()) + this->WriteLine(std::string(":")+this->Instance->Config->ServerName+" FMODE "+c->name+" "+ConvToStr(c->age)+" +"+modes+params); } /** Send G, Q, Z and E lines */ -- cgit v1.2.3