update resource-specific chat controls when that resource comes back online

This commit is contained in:
Brendan Taylor 2008-07-26 18:44:47 +00:00
parent abbdf8d5c9
commit 2bb2c452c6
1 changed files with 12 additions and 11 deletions

View File

@ -1978,20 +1978,21 @@ class RosterWindow:
# Remove resource when going offline # Remove resource when going offline
if show in ('offline', 'error') and \ if show in ('offline', 'error') and \
len(gajim.events.get_events(account, contact.get_full_jid())) == 0: len(gajim.events.get_events(account, contact.get_full_jid())) == 0:
jid_with_resource = contact.jid + '/' + contact.resource fjid = contact.jid + '/' + contact.resource
if gajim.interface.msg_win_mgr.has_window(jid_with_resource, ctrl = gajim.interface.msg_win_mgr.get_control(
account): fjid, account)
win = gajim.interface.msg_win_mgr.get_window(jid_with_resource, if ctrl:
account) ctrl.update_ui()
ctrl = win.get_control(jid_with_resource, account) ctrl.parent_win.redraw_tab(ctrl)
if ctrl: # keep the contact around, since it's
ctrl.update_ui() # already attached to the control
win.redraw_tab(ctrl) else:
gajim.contacts.remove_contact(account, contact) gajim.contacts.remove_contact(account, contact)
elif contact.jid == gajim.get_jid_from_account(account) and \ elif contact.jid == gajim.get_jid_from_account(account) and \
show in ('offline', 'error'): show in ('offline', 'error'):
# SelfContact went offline. Remove him when last pending message was read # SelfContact went offline. Remove him when last pending
# message was read
self.remove_contact(contact.jid, account, backend=True) self.remove_contact(contact.jid, account, backend=True)
uf_show = helpers.get_uf_show(show) uf_show = helpers.get_uf_show(show)