diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 22:53:41 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 22:53:41 +0000 |
commit | 8e982095e2784bf25bb4e7b4f0323087c3283a34 (patch) | |
tree | 04383d7489622d83568559932e987dace33434e9 | |
parent | 26f48e3db3738d9bee7e317f7aa43f53e4ee1bb4 (diff) |
Sort CAPAB CHANMODES and USERMODES
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12416 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree/capab.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
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<std::string> 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) |