diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-28 18:01:43 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-28 18:01:43 +0000 |
commit | afc96cde1f0bf2bf8fa14e04fcabe652735b63c0 (patch) | |
tree | 110b9899eff7fd2138f13fc8dac8be54c7a3a56b /src | |
parent | 2deb8b3830b76bbca728b1302d1c2e235b50ed70 (diff) |
Zed, you are found guilty of over-assuming the IRC protocol and forcing ircd developers to sort lists during prefix adding. How do you plead.
SOD THAT, YOURE GUILTY!!!!!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5052 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 780251f5f..ba4277eb5 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -921,20 +921,12 @@ const char* chanrec::GetAllPrefixChars(userrec* user) int ctr = 0; *prefix = 0; - /* Cheat and always put the highest first. - * This fixes a NASTY ass-umption in xchat. - */ - const char* first = this->GetPrefixChar(user); - if (*first) - prefix[ctr++] = *first; - prefixlist::iterator n = prefixes.find(user); if (n != prefixes.end()) { for (std::vector<prefixtype>::iterator x = n->second.begin(); x != n->second.end(); x++) { - if (x->first != *first) - prefix[ctr++] = x->first; + prefix[ctr++] = x->first; } } @@ -1001,6 +993,11 @@ int chanrec::GetStatus(userrec *user) return STATUS_NORMAL; } +/*bool ModeParser::PrefixComparison(const prefixtype one, const prefixtype two) +{ + return one.second > two.second; +}*/ + void chanrec::SetPrefix(userrec* user, char prefix, unsigned int prefix_value, bool adding) { prefixlist::iterator n = prefixes.find(user); @@ -1012,6 +1009,7 @@ void chanrec::SetPrefix(userrec* user, char prefix, unsigned int prefix_value, b if (std::find(n->second.begin(), n->second.end(), pfx) == n->second.end()) { n->second.push_back(pfx); + std::sort(n->second.begin(), n->second.end(), ModeParser::PrefixComparison); } } else |