make sure we are disconnected, before relogin
This commit is contained in:
parent
f1f385f7c3
commit
2b845f6fd5
1 changed files with 9 additions and 2 deletions
|
@ -1307,6 +1307,13 @@ class AccountModificationWindow:
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
if relogin_needed:
|
if relogin_needed:
|
||||||
|
def login(account, show_before, status_before):
|
||||||
|
''' login with previous status'''
|
||||||
|
# first make sure connection is really closed,
|
||||||
|
# 0.5 may not be enough
|
||||||
|
gajim.connections[account].disconnect(True)
|
||||||
|
gajim.interface.roster.send_status(account, show_before,
|
||||||
|
status_before)
|
||||||
def relog(widget):
|
def relog(widget):
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
show_before = gajim.SHOW_LIST[gajim.connections[self.account].\
|
show_before = gajim.SHOW_LIST[gajim.connections[self.account].\
|
||||||
|
@ -1314,8 +1321,8 @@ class AccountModificationWindow:
|
||||||
status_before = gajim.connections[self.account].status
|
status_before = gajim.connections[self.account].status
|
||||||
gajim.interface.roster.send_status(self.account, 'offline',
|
gajim.interface.roster.send_status(self.account, 'offline',
|
||||||
_('Be right back.'))
|
_('Be right back.'))
|
||||||
gobject.timeout_add(500, gajim.interface.roster.send_status,
|
gobject.timeout_add(500, login, self.account, show_before,
|
||||||
self.account, show_before, status_before)
|
status_before)
|
||||||
self.dialog = dialogs.YesNoDialog(_('Relogin now?'),
|
self.dialog = dialogs.YesNoDialog(_('Relogin now?'),
|
||||||
_('If you want all the changes to apply instantly, '
|
_('If you want all the changes to apply instantly, '
|
||||||
'you must relogin.'), on_response_yes = relog)
|
'you must relogin.'), on_response_yes = relog)
|
||||||
|
|
Loading…
Add table
Reference in a new issue