Author: jim++ Date: 2008-07-07 00:24:19 +0200 (Mon, 07 Jul 2008) New Revision: 9893
Modified: trunk/src/groupchat_control.py Log: 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.
Modified: trunk/src/groupchat_control.py =================================================================== --- trunk/src/groupchat_control.py 2008-07-06 21:35:19 UTC (rev 9892) +++ trunk/src/groupchat_control.py 2008-07-06 22:24:19 UTC (rev 9893) @@ -1867,7 +1867,9 @@
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 @@ 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 @@ 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