order resources and status the same way in information window. fixes #3225
This commit is contained in:
parent
55aa74afc7
commit
aefe6fd370
1 changed files with 15 additions and 9 deletions
24
src/vcard.py
24
src/vcard.py
|
@ -258,18 +258,24 @@ class VcardWindow:
|
||||||
connected_contact_list = contact_list
|
connected_contact_list = contact_list
|
||||||
# stats holds show and status message
|
# stats holds show and status message
|
||||||
stats = ''
|
stats = ''
|
||||||
one = True # Are we adding the first line ?
|
|
||||||
if connected_contact_list:
|
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:
|
for c in connected_contact_list:
|
||||||
if not one:
|
if c.resource != self.contact.resource:
|
||||||
stats += '\n'
|
stats += '\n'
|
||||||
stats += helpers.get_uf_show(c.show)
|
stats += helpers.get_uf_show(c.show)
|
||||||
if c.status:
|
if c.status:
|
||||||
stats += ': ' + c.status
|
stats += ': ' + c.status
|
||||||
if c.last_status_time:
|
if c.last_status_time:
|
||||||
stats += '\n' + _('since %s') % time.strftime('%c',
|
stats += '\n' + _('since %s') % time.strftime('%c',
|
||||||
c.last_status_time).decode(locale.getpreferredencoding())
|
c.last_status_time).decode(locale.getpreferredencoding())
|
||||||
one = False
|
|
||||||
else: # Maybe gc_vcard ?
|
else: # Maybe gc_vcard ?
|
||||||
stats = helpers.get_uf_show(self.contact.show)
|
stats = helpers.get_uf_show(self.contact.show)
|
||||||
if self.contact.status:
|
if self.contact.status:
|
||||||
|
|
Loading…
Add table
Reference in a new issue