summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-01 22:51:19 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-01 22:51:19 +0000
commit2d90ee68ea63eaf95cf2f8a33625f28ef5c4e503 (patch)
treeafe09b5242e726bc1c2ad583fb772a5ba9f83689 /src/gui.py
parent432bab0b6ba56db5956b823a297347494f09cbd7 (diff)
downloadpoezio-2d90ee68ea63eaf95cf2f8a33625f28ef5c4e503.tar.gz
poezio-2d90ee68ea63eaf95cf2f8a33625f28ef5c4e503.tar.bz2
poezio-2d90ee68ea63eaf95cf2f8a33625f28ef5c4e503.tar.xz
poezio-2d90ee68ea63eaf95cf2f8a33625f28ef5c4e503.zip
Available users now have a greater priority on nickname completion. fixed #1560
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui.py b/src/gui.py
index 9e4fe8ed..bff9c3be 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -232,7 +232,16 @@ class Gui(object):
"""
Called when Tab is pressed, complete the nickname in the input
"""
- self.window.input.auto_completion(self.current_room().users)
+ def compare_users(a, b):
+ """
+ Used to sort users by their availability
+ """
+ if a.show == b.show:
+ return 0
+ if a.show is None:
+ return -1
+ return 1
+ self.window.input.auto_completion(sorted(self.current_room().users, compare_users))
def rotate_rooms_right(self, args=None):
"""