don't allow sending messages via local account when offline or invisible

This commit is contained in:
Stefan Bethge 2006-10-20 17:02:38 +00:00
parent d98263c5e8
commit 18ef6edb74
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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):