From d7e03c2b55acd8dd2721284fda01331671bb629e Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 16 Jan 2010 21:23:27 +0000 Subject: Fix use of commasepstream on now space-separated items git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12272 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/capab.cpp | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index e855eb49f..f76c78f80 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -79,42 +79,43 @@ void TreeSocket::SendCapabilities(int phase) if (phase < 2) return; - irc::commasepstream modulelist(MyModules(VF_COMMON)); - irc::commasepstream optmodulelist(MyModules(VF_OPTCOMMON)); + char sep = proto_version > 1201 ? ' ' : ','; + irc::sepstream modulelist(MyModules(VF_COMMON), sep); + irc::sepstream optmodulelist(MyModules(VF_OPTCOMMON), sep); /* Send module names, split at 509 length */ std::string item; - std::string line = "CAPAB MODULES "; + std::string line = "CAPAB MODULES :"; while (modulelist.GetToken(item)) { if (line.length() + item.length() + 1 > 509) { this->WriteLine(line); - line = "CAPAB MODULES "; + line = "CAPAB MODULES :"; } - if (line != "CAPAB MODULES ") - line.append(","); + if (line != "CAPAB MODULES :") + line.push_back(sep); line.append(item); } - if (line != "CAPAB MODULES ") + if (line != "CAPAB MODULES :") this->WriteLine(line); - line = "CAPAB MODSUPPORT "; + line = "CAPAB MODSUPPORT :"; while (optmodulelist.GetToken(item)) { if (line.length() + item.length() + 1 > 509) { this->WriteLine(line); - line = "CAPAB MODSUPPORT "; + line = "CAPAB MODSUPPORT :"; } - if (line != "CAPAB MODSUPPORT ") - line.append(","); + if (line != "CAPAB MODSUPPORT :") + line.push_back(sep); line.append(item); } - if (line != "CAPAB MODSUPPORT ") + if (line != "CAPAB MODSUPPORT :") this->WriteLine(line); WriteLine("CAPAB CHANMODES :" + BuildModeList(MODETYPE_CHANNEL)); @@ -334,26 +335,26 @@ bool TreeSocket::Capab(const parameterlist ¶ms) } else if ((params[0] == "MODULES") && (params.size() == 2)) { - if (!this->capab->ModuleList.length()) + if (!capab->ModuleList.length()) { - this->capab->ModuleList.append(params[1]); + capab->ModuleList = params[1]; } else { - this->capab->ModuleList.append(","); - this->capab->ModuleList.append(params[1]); + capab->ModuleList.push_back(proto_version > 1201 ? ' ' : ','); + capab->ModuleList.append(params[1]); } } else if ((params[0] == "MODSUPPORT") && (params.size() == 2)) { - if (!this->capab->OptModuleList.length()) + if (!capab->OptModuleList.length()) { - this->capab->OptModuleList.append(params[1]); + capab->OptModuleList = params[1]; } else { - this->capab->OptModuleList.append(","); - this->capab->OptModuleList.append(params[1]); + capab->OptModuleList.push_back(' '); + capab->OptModuleList.append(params[1]); } } else if ((params[0] == "CHANMODES") && (params.size() == 2)) -- cgit v1.2.3