]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Zed, you are found guilty of over-assuming the IRC protocol and forcing ircd develope...
[user/henk/code/inspircd.git] / src / channels.cpp
index 780251f5f9c34bcb756a5275ffde9f48bc757d01..ba4277eb50f08629be68f441e1b60e9cb789aad1 100644 (file)
@@ -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