Display version/os information correctly in VCard window
On contacts with multiple resources, not all information was displayed.
This commit is contained in:
parent
1b4360a94e
commit
fa75bdeddd
1 changed files with 30 additions and 15 deletions
45
src/vcard.py
45
src/vcard.py
|
@ -312,16 +312,29 @@ class VcardWindow:
|
||||||
return
|
return
|
||||||
if self.xml.get_object('information_notebook').get_n_pages() < 5:
|
if self.xml.get_object('information_notebook').get_n_pages() < 5:
|
||||||
return
|
return
|
||||||
if obj.fjid != self.contact.jid and obj.fjid != self.real_jid:
|
if self.gc_contact:
|
||||||
|
if obj.fjid != self.contact.jid:
|
||||||
|
return
|
||||||
|
elif gajim.get_jid_without_resource(obj.fjid) != self.contact.jid:
|
||||||
return
|
return
|
||||||
i = 0
|
i = 0
|
||||||
client = ''
|
client = ''
|
||||||
os = ''
|
os = ''
|
||||||
while i in self.os_info:
|
while i in self.os_info:
|
||||||
if not self.os_info[i]['resource'] or \
|
if self.os_info[i]['resource'] == obj.resource:
|
||||||
self.os_info[i]['resource'] == obj.resource:
|
if obj.client_info:
|
||||||
self.os_info[i]['client'] = obj.client_info
|
self.os_info[i]['client'] = obj.client_info
|
||||||
self.os_info[i]['os'] = obj.os_info
|
else:
|
||||||
|
self.os_info[i]['client'] = Q_('?Client:Unknown')
|
||||||
|
if obj.os_info:
|
||||||
|
self.os_info[i]['os'] = obj.os_info
|
||||||
|
else:
|
||||||
|
self.os_info[i]['os'] = Q_('?OS:Unknown')
|
||||||
|
else:
|
||||||
|
if not self.os_info[i]['client']:
|
||||||
|
self.os_info[i]['client'] = Q_('?Client:Unknown')
|
||||||
|
if not self.os_info[i]['os']:
|
||||||
|
self.os_info[i]['os'] = Q_('?OS:Unknown')
|
||||||
if i > 0:
|
if i > 0:
|
||||||
client += '\n'
|
client += '\n'
|
||||||
os += '\n'
|
os += '\n'
|
||||||
|
@ -329,10 +342,6 @@ class VcardWindow:
|
||||||
os += self.os_info[i]['os']
|
os += self.os_info[i]['os']
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
if client == '':
|
|
||||||
client = Q_('?Client:Unknown')
|
|
||||||
if os == '':
|
|
||||||
os = Q_('?OS:Unknown')
|
|
||||||
self.xml.get_object('client_name_version_label').set_text(client)
|
self.xml.get_object('client_name_version_label').set_text(client)
|
||||||
self.xml.get_object('os_label').set_text(os)
|
self.xml.get_object('os_label').set_text(os)
|
||||||
self.os_info_arrived = True
|
self.os_info_arrived = True
|
||||||
|
@ -342,21 +351,27 @@ class VcardWindow:
|
||||||
return
|
return
|
||||||
if self.xml.get_object('information_notebook').get_n_pages() < 5:
|
if self.xml.get_object('information_notebook').get_n_pages() < 5:
|
||||||
return
|
return
|
||||||
if obj.fjid != self.contact.jid and obj.fjid != self.real_jid:
|
if self.gc_contact:
|
||||||
|
if obj.fjid != self.contact.jid:
|
||||||
|
return
|
||||||
|
elif gajim.get_jid_without_resource(obj.fjid) != self.contact.jid:
|
||||||
return
|
return
|
||||||
i = 0
|
i = 0
|
||||||
time_s = ''
|
time_s = ''
|
||||||
while i in self.time_info:
|
while i in self.time_info:
|
||||||
if not self.time_info[i]['resource'] or \
|
if self.time_info[i]['resource'] == obj.resource:
|
||||||
self.time_info[i]['resource'] == obj.resource:
|
if obj.time_info:
|
||||||
self.time_info[i]['time'] = obj.time_info
|
self.time_info[i]['time'] = obj.time_info
|
||||||
|
else:
|
||||||
|
self.time_info[i]['time'] = Q_('?Time:Unknown')
|
||||||
|
else:
|
||||||
|
if not self.time_info[i]['time']:
|
||||||
|
self.time_info[i]['time'] = Q_('?Time:Unknown')
|
||||||
if i > 0:
|
if i > 0:
|
||||||
time_s += '\n'
|
time_s += '\n'
|
||||||
time_s += self.time_info[i]['time']
|
time_s += self.time_info[i]['time']
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
if time_s == '':
|
|
||||||
time_s = Q_('?Time:Unknown')
|
|
||||||
self.xml.get_object('time_label').set_text(time_s)
|
self.xml.get_object('time_label').set_text(time_s)
|
||||||
self.entity_time_arrived = True
|
self.entity_time_arrived = True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue