idle autostatus is activated only when we sign in. Fixes #1874

This commit is contained in:
Yann Leboulanger 2006-04-20 17:06:05 +00:00
parent d040cc13fc
commit d42bba202b
2 changed files with 4 additions and 5 deletions

View File

@ -1313,6 +1313,10 @@ class Interface:
def handle_event_signed_in(self, account, empty): def handle_event_signed_in(self, account, empty):
'''SIGNED_IN event is emitted when we sign in, so handle it''' '''SIGNED_IN event is emitted when we sign in, so handle it'''
self.roster.actions_menu_needs_rebuild = True self.roster.actions_menu_needs_rebuild = True
if gajim.interface.sleeper.getState() != common.sleepy.STATE_UNKNOWN:
gajim.sleeper_state[account] = 'online'
else:
gajim.sleeper_state[account] = 0
invisible_show = gajim.SHOW_LIST.index('invisible') invisible_show = gajim.SHOW_LIST.index('invisible')
# We cannot join rooms if we are invisible # We cannot join rooms if we are invisible
if gajim.connections[account].connected == invisible_show: if gajim.connections[account].connected == invisible_show:

View File

@ -1930,11 +1930,6 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
gajim.connections[account].send_gc_status(gc_control.nick, gajim.connections[account].send_gc_status(gc_control.nick,
gc_control.room_jid, status, txt) gc_control.room_jid, status, txt)
gajim.connections[account].change_status(status, txt, sync, auto) 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'
else:
gajim.sleeper_state[account] = 'off'
def get_status_message(self, show): def get_status_message(self, show):
if (show == 'online' and not gajim.config.get('ask_online_status')) or \ if (show == 'online' and not gajim.config.get('ask_online_status')) or \