From 926953252b66e17877454d063a339ad655ba52de Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Sun, 6 Jul 2008 22:24:19 +0000 Subject: [PATCH] Make nick completion work fine with an empty refer_to_nick_char Make nick completion sorted case-insensitive. Fixes #4063. (was already IMO) Restore #2975 way. Last nick that highlighted us are first. Fixes #2975. --- src/groupchat_control.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index fac97d6c9..e9a028080 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -1867,7 +1867,9 @@ class GroupchatControl(ChatControlBase): gc_refer_to_nick_char = gajim.config.get('gc_refer_to_nick_char') with_refer_to_nick_char = False - if begin.endswith(gc_refer_to_nick_char): + + # first part of this if : works fine even if refer_to_nick_char + if gc_refer_to_nick_char and begin.endswith(gc_refer_to_nick_char): with_refer_to_nick_char = True if len(self.nick_hits) and self.last_key_tabs and \ (text[:-1].endswith(self.nick_hits[0]) or \ @@ -1880,6 +1882,7 @@ class GroupchatControl(ChatControlBase): self.nick_hits = [] # clear the hit list list_nick = gajim.contacts.get_nick_list(self.account, self.room_jid) + list_nick.sort(key=unicode.lower) # case-insensitive sort if begin == '': # empty message, show lasts nicks that highlighted us first for nick in self.attention_list: @@ -1888,7 +1891,6 @@ class GroupchatControl(ChatControlBase): list_nick.insert(0, nick) list_nick.remove(self.nick) # Skip self - list_nick.sort() for nick in list_nick: if nick.lower().startswith(begin.lower()): # the word is the begining of a nick