Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Taylor <bct@diffeq.com>2008-07-26 22:44:47 +0400
committerBrendan Taylor <bct@diffeq.com>2008-07-26 22:44:47 +0400
commit2bb2c452c651f8b3126a0baa5fb2b654e240fc44 (patch)
treec7536b2821729dc6f2793a78d2c060ab963ee975
parentabbdf8d5c923ed5018086451279853e704d29610 (diff)
update resource-specific chat controls when that resource comes back online
-rw-r--r--src/roster_window.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/roster_window.py b/src/roster_window.py
index a696b312b..d2fd5d10a 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -1978,20 +1978,21 @@ class RosterWindow:
# Remove resource when going offline
if show in ('offline', 'error') and \
len(gajim.events.get_events(account, contact.get_full_jid())) == 0:
- jid_with_resource = contact.jid + '/' + contact.resource
- if gajim.interface.msg_win_mgr.has_window(jid_with_resource,
- account):
- win = gajim.interface.msg_win_mgr.get_window(jid_with_resource,
- account)
- ctrl = win.get_control(jid_with_resource, account)
- if ctrl:
- ctrl.update_ui()
- win.redraw_tab(ctrl)
- gajim.contacts.remove_contact(account, contact)
+ fjid = contact.jid + '/' + contact.resource
+ ctrl = gajim.interface.msg_win_mgr.get_control(
+ fjid, account)
+ if ctrl:
+ ctrl.update_ui()
+ ctrl.parent_win.redraw_tab(ctrl)
+ # keep the contact around, since it's
+ # already attached to the control
+ else:
+ gajim.contacts.remove_contact(account, contact)
elif contact.jid == gajim.get_jid_from_account(account) and \
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)
uf_show = helpers.get_uf_show(show)