From e05dc901d401c93119815d379eb0e0c158b6eae4 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 1 Jun 2005 12:22:05 +0000 Subject: [PATCH] if show is not in cshow dict, the contact is put at the end --- src/roster_window.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index e41edc850..ed433d4e5 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1403,8 +1403,16 @@ class Roster_window: luser2 = self.contacts[account][jid2] cshow = {'online':0, 'chat': 1, 'away':2, 'xa':3, 'dnd':4, 'invisible':5, 'offline':6, 'not in the roster':7, 'error':8} - show1 = cshow[self.get_show(luser1)] - show2 = cshow[self.get_show(luser2)] + s = self.get_show(luser1) + if s in cshow: + show1 = cshow[s] + else: + show1 = 9 + s = self.get_show(luser2) + if s in cshow: + show2 = cshow[s] + else: + show2 = 9 if show1 < show2: return -1 elif show1 > show2: