redraw correctly tabs / banner when sevral resources

This commit is contained in:
Yann Leboulanger 2006-03-14 18:18:34 +00:00
parent f355cb043a
commit 6ca8c5334c
2 changed files with 23 additions and 22 deletions

View File

@ -785,7 +785,7 @@ class ChatControl(ChatControlBase):
def _update_banner_state_image(self):
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
self.contact.jid)
if not contact:
if not contact or self.resource:
# For transient contacts
contact = self.contact
show = contact.show
@ -846,7 +846,7 @@ class ChatControl(ChatControlBase):
acct_info = ' (%s)' % \
gtkgui_helpers.escape_for_pango_markup(self.account)
break
status = contact.status
if status is not None:
banner_name_label.set_ellipsize(pango.ELLIPSIZE_END)
@ -1119,7 +1119,7 @@ class ChatControl(ChatControlBase):
else:
contact = gajim.contacts.get_contact_with_highest_priority(self.account,
self.contact.jid)
if not contact:
if not contact or self.resource:
# For transient contacts
contact = self.contact
img_16 = gajim.interface.roster.get_appropriate_state_images(

View File

@ -871,26 +871,27 @@ class RosterWindow:
self.add_contact_to_roster(contact.jid, account)
self.draw_contact(contact.jid, account)
# print status in chat window and update status/GPG image
if gajim.interface.msg_win_mgr.has_window(contact.jid, account):
jid = contact.jid
win = gajim.interface.msg_win_mgr.get_window(contact.jid, account)
ctrl = win.get_control(jid, account)
ctrl.update_ui()
win.redraw_tab(ctrl)
name = contact.get_shown_name()
if contact.resource != '':
name += '/' + contact.resource
uf_show = helpers.get_uf_show(show)
if status:
ctrl.print_conversation(_('%s is now %s (%s)') % (name, uf_show, status),
for j in (contact.jid, contact.get_full_jid()):
if gajim.interface.msg_win_mgr.has_window(j, account):
jid = contact.jid
win = gajim.interface.msg_win_mgr.get_window(j, account)
ctrl = win.get_control(j, account)
ctrl.update_ui()
win.redraw_tab(ctrl)
name = contact.get_shown_name()
if contact.resource != '':
name += '/' + contact.resource
uf_show = helpers.get_uf_show(show)
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')
else: # No status message
ctrl.print_conversation(_('%s is now %s') % (name, uf_show),
'status')
if contact == gajim.contacts.get_contact_with_highest_priority(account,
contact.jid):
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):
'''Call vcard_information_window class to display contact's information'''