redraw correctly tabs / banner when sevral resources
This commit is contained in:
parent
f355cb043a
commit
6ca8c5334c
2 changed files with 23 additions and 22 deletions
|
@ -785,7 +785,7 @@ class ChatControl(ChatControlBase):
|
||||||
def _update_banner_state_image(self):
|
def _update_banner_state_image(self):
|
||||||
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
|
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
|
||||||
self.contact.jid)
|
self.contact.jid)
|
||||||
if not contact:
|
if not contact or self.resource:
|
||||||
# For transient contacts
|
# For transient contacts
|
||||||
contact = self.contact
|
contact = self.contact
|
||||||
show = contact.show
|
show = contact.show
|
||||||
|
@ -846,7 +846,7 @@ class ChatControl(ChatControlBase):
|
||||||
acct_info = ' (%s)' % \
|
acct_info = ' (%s)' % \
|
||||||
gtkgui_helpers.escape_for_pango_markup(self.account)
|
gtkgui_helpers.escape_for_pango_markup(self.account)
|
||||||
break
|
break
|
||||||
|
|
||||||
status = contact.status
|
status = contact.status
|
||||||
if status is not None:
|
if status is not None:
|
||||||
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
|
||||||
|
@ -1119,7 +1119,7 @@ class ChatControl(ChatControlBase):
|
||||||
else:
|
else:
|
||||||
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
|
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
|
||||||
self.contact.jid)
|
self.contact.jid)
|
||||||
if not contact:
|
if not contact or self.resource:
|
||||||
# For transient contacts
|
# For transient contacts
|
||||||
contact = self.contact
|
contact = self.contact
|
||||||
img_16 = gajim.interface.roster.get_appropriate_state_images(
|
img_16 = gajim.interface.roster.get_appropriate_state_images(
|
||||||
|
|
|
@ -871,26 +871,27 @@ class RosterWindow:
|
||||||
self.add_contact_to_roster(contact.jid, account)
|
self.add_contact_to_roster(contact.jid, account)
|
||||||
self.draw_contact(contact.jid, account)
|
self.draw_contact(contact.jid, account)
|
||||||
# print status in chat window and update status/GPG image
|
# print status in chat window and update status/GPG image
|
||||||
if gajim.interface.msg_win_mgr.has_window(contact.jid, account):
|
for j in (contact.jid, contact.get_full_jid()):
|
||||||
jid = contact.jid
|
if gajim.interface.msg_win_mgr.has_window(j, account):
|
||||||
win = gajim.interface.msg_win_mgr.get_window(contact.jid, account)
|
jid = contact.jid
|
||||||
ctrl = win.get_control(jid, account)
|
win = gajim.interface.msg_win_mgr.get_window(j, account)
|
||||||
ctrl.update_ui()
|
ctrl = win.get_control(j, account)
|
||||||
win.redraw_tab(ctrl)
|
ctrl.update_ui()
|
||||||
|
win.redraw_tab(ctrl)
|
||||||
name = contact.get_shown_name()
|
|
||||||
if contact.resource != '':
|
name = contact.get_shown_name()
|
||||||
name += '/' + contact.resource
|
if contact.resource != '':
|
||||||
uf_show = helpers.get_uf_show(show)
|
name += '/' + contact.resource
|
||||||
if status:
|
uf_show = helpers.get_uf_show(show)
|
||||||
ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show, status),
|
if status:
|
||||||
|
ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show,
|
||||||
|
status), 'status')
|
||||||
|
else: # No status message
|
||||||
|
ctrl.print_conversation(_('%s is now %s') % (name, uf_show),
|
||||||
'status')
|
'status')
|
||||||
else: # No status message
|
if contact == gajim.contacts.get_contact_with_highest_priority(
|
||||||
ctrl.print_conversation(_('%s is now %s') % (name, uf_show),
|
account, contact.jid):
|
||||||
'status')
|
ctrl.draw_banner()
|
||||||
if contact == gajim.contacts.get_contact_with_highest_priority(account,
|
|
||||||
contact.jid):
|
|
||||||
ctrl.draw_banner()
|
|
||||||
|
|
||||||
def on_info(self, widget, contact, account):
|
def on_info(self, widget, contact, account):
|
||||||
'''Call vcard_information_window class to display contact's information'''
|
'''Call vcard_information_window class to display contact's information'''
|
||||||
|
|
Loading…
Add table
Reference in a new issue