Deal with unknow status, thanks Yann for idea.

This commit is contained in:
Jean-Marie Traissard 2006-04-18 18:01:07 +00:00
parent 53764afbe7
commit 3a27a78e36
1 changed files with 6 additions and 4 deletions

View File

@ -292,14 +292,16 @@ class Systray:
if group == _('Transports'): if group == _('Transports'):
continue continue
contact_name = contact.get_shown_name() contact_name = contact.get_shown_name()
try:
show = show_list.index(contact.show)
except ValueError: # unknown show
show = 0 # offline
if sort_by_show: # see comment about contacts_table above if sort_by_show: # see comment about contacts_table above
contacts_table.append ([group, show_list.index(contact.show), contacts_table.append ([group, show, contact_name.lower(),
contact_name.lower(),
contact.jid, contact_name]) contact.jid, contact_name])
else: else:
contacts_table.append ([group, contact_name.lower(), contacts_table.append ([group, contact_name.lower(),
show_list.index(contact.show), show, contact.jid, contact_name])
contact.jid, contact_name])
# Sort : first column before, last column in the end # Sort : first column before, last column in the end
# In theory we sort full table, including columns that don't need sorting, # In theory we sort full table, including columns that don't need sorting,