Always put own nick last in nick completion
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 25 Feb 2009 19:21:06 +0000 (20:21 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 25 Feb 2009 19:21:06 +0000 (20:21 +0100)
src/uisupport/tabcompleter.cpp

index 311801a..695923f 100644 (file)
@@ -150,7 +150,13 @@ bool TabCompleter::eventFilter(QObject *obj, QEvent *event) {
 // this determines the sort order
 bool TabCompleter::CompletionKey::operator<(const CompletionKey &other) const {
   IrcUser *thisUser = _currentNetwork->ircUser(this->nick);
 // this determines the sort order
 bool TabCompleter::CompletionKey::operator<(const CompletionKey &other) const {
   IrcUser *thisUser = _currentNetwork->ircUser(this->nick);
+  if(thisUser && _currentNetwork->isMe(thisUser))
+    return false;
+
   IrcUser *thatUser = _currentNetwork->ircUser(other.nick);
   IrcUser *thatUser = _currentNetwork->ircUser(other.nick);
+  if(thatUser && _currentNetwork->isMe(thatUser))
+    return true;
+
   if(!thisUser || !thatUser)
     return QString::localeAwareCompare(this->nick, other.nick) < 0;
 
   if(!thisUser || !thatUser)
     return QString::localeAwareCompare(this->nick, other.nick) < 0;