From: brain Date: Mon, 28 Aug 2006 17:55:16 +0000 (+0000) Subject: YOU KNOW I REALLY HATE IT WHEN CLIENT AUTHORS JUST MAKE ASSUMPTIONS ON THINGS LIKE... X-Git-Tag: v2.0.23~7287 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=2deb8b3830b76bbca728b1302d1c2e235b50ed70;p=user%2Fhenk%2Fcode%2Finspircd.git YOU KNOW I REALLY HATE IT WHEN CLIENT AUTHORS JUST MAKE ASSUMPTIONS ON THINGS LIKE "oh all prefixes in NAMESX will always be in rank order". So tell me, zed, where the FUCK does it say that? huh?! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5051 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/channels.cpp b/src/channels.cpp index 345ec79dd..780251f5f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -921,12 +921,20 @@ 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::iterator x = n->second.begin(); x != n->second.end(); x++) { - prefix[ctr++] = x->first; + if (x->first != *first) + prefix[ctr++] = x->first; } }