From aefe6fd37016310a12cfc146950f482f49bd384a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 20 Aug 2007 08:16:26 +0000 Subject: [PATCH] order resources and status the same way in information window. fixes #3225 --- src/vcard.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/vcard.py b/src/vcard.py index 3e11a3cb6..fdf781639 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -258,18 +258,24 @@ class VcardWindow: connected_contact_list = contact_list # stats holds show and status message stats = '' - one = True # Are we adding the first line ? if connected_contact_list: + # Start with self.contact, as with resources + stats = helpers.get_uf_show(self.contact.show) + if self.contact.status: + stats += ': ' + self.contact.status + if self.contact.last_status_time: + stats += '\n' + _('since %s') % time.strftime('%c', + self.contact.last_status_time).decode( + locale.getpreferredencoding()) for c in connected_contact_list: - if not one: + if c.resource != self.contact.resource: stats += '\n' - stats += helpers.get_uf_show(c.show) - if c.status: - stats += ': ' + c.status - if c.last_status_time: - stats += '\n' + _('since %s') % time.strftime('%c', - c.last_status_time).decode(locale.getpreferredencoding()) - one = False + stats += helpers.get_uf_show(c.show) + if c.status: + stats += ': ' + c.status + if c.last_status_time: + stats += '\n' + _('since %s') % time.strftime('%c', + c.last_status_time).decode(locale.getpreferredencoding()) else: # Maybe gc_vcard ? stats = helpers.get_uf_show(self.contact.show) if self.contact.status: