From cec9b1e861958fe385e1fdde134439c13f6fbcbc Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 30 Nov 2005 17:54:34 +0000 Subject: [PATCH] send offline status to gc before we disconnect --- src/common/connection.py | 4 +++- src/roster_window.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 5937dc803..59764de94 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -2215,7 +2215,9 @@ class Connection: p = common.xmpp.Presence(to = '%s/%s' % (jid, nick), typ = ptype, show = show, status = status) p = self.add_sha(p) - self.to_be_sent.append(p) + # send instantly so when we go offline, status is sent to gc before we + # disconnect from jabber server + self.connection.send(p) def gc_set_role(self, room_jid, nick, role, reason = ''): '''role is for all the life of the room so it's based on nick''' diff --git a/src/roster_window.py b/src/roster_window.py index edd81d97f..16474beda 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1491,12 +1491,12 @@ _('If "%s" accepts this request you will know his or her status.') %jid) passphrase) gajim.connections[account].gpg_passphrase(passphrase) - gajim.connections[account].change_status(status, txt, sync, auto) for room_jid in gajim.interface.instances[account]['gc']: if room_jid != 'tabbed': nick = gajim.interface.instances[account]['gc'][room_jid].nicks[room_jid] gajim.connections[account].send_gc_status(nick, room_jid, status, txt) + gajim.connections[account].change_status(status, txt, sync, auto) if status == 'online' and gajim.interface.sleeper.getState() != \ common.sleepy.STATE_UNKNOWN: gajim.sleeper_state[account] = 'online'