From 8e982095e2784bf25bb4e7b4f0323087c3283a34 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 9 Feb 2010 22:53:41 +0000 Subject: Sort CAPAB CHANMODES and USERMODES git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12416 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/capab.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp index ba34d67b4..808b5900a 100644 --- a/src/modules/m_spanningtree/capab.cpp +++ b/src/modules/m_spanningtree/capab.cpp @@ -49,22 +49,24 @@ std::string TreeSocket::MyModules(int filter) static std::string BuildModeList(ModeType type) { - std::string line; + std::vector modes; for(char c='A'; c <= 'z'; c++) { - ModeHandler* mh = ServerInstance->Modes->FindMode(c, type); + ModeHandler* mh = ServerInstance->Modes->FindMode(c, type) if (mh) { - if (!line.empty()) - line.push_back(' '); - line.append(mh->name); - line.push_back('='); + std::string mdesc = mh->name; + mdesc.push_back('='); if (mh->GetPrefix()) - line.push_back(mh->GetPrefix()); - line.push_back(c); + mdesc.push_back(mh->GetPrefix()); + if (mh->GetModeChar()) + mdesc.push_back(mh->GetModeChar()); + modes.push_back(mdesc); } } - return line; + sort(modes.begin(), modes.end()); + irc::stringjoiner line(" ", modes, 0, modes.size() - 1); + return line.GetJoined(); } void TreeSocket::SendCapabilities(int phase) -- cgit v1.2.3