From 18ef6edb742b8de4d07b2732ca8b3393c34862d6 Mon Sep 17 00:00:00 2001 From: Stefan Bethge Date: Fri, 20 Oct 2006 17:02:38 +0000 Subject: [PATCH] don't allow sending messages via local account when offline or invisible --- src/gajim.py | 3 ++- src/roster_window.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gajim.py b/src/gajim.py index 145ab30e5..44c8e1616 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -329,7 +329,8 @@ class Interface: # Inform all controls for this account of the connection state change for ctrl in self.msg_win_mgr.get_controls(): if ctrl.account == account: - if status == 'offline': + if status == 'offline' or (status == 'invisible' and \ + gajim.connections[account].is_zeroconf): ctrl.got_disconnected() else: # Other code rejoins all GCs, so we don't do it here diff --git a/src/roster_window.py b/src/roster_window.py index 39b69cbcf..93aca0089 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -3120,6 +3120,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid) # last message is long time ago gajim.last_message_time[account][ctrl.get_full_jid()] = 0 win.set_active_tab(fjid, account) + if gajim.connections[account].is_zeroconf and \ + gajim.connections[account].status in ('offline', 'invisible'): + win.get_control(fjid, account).got_disconnected() win.window.present() def on_roster_treeview_row_activated(self, widget, path, col = 0):