when unregistering an account, wait server answer before closing connection.
This commit is contained in:
parent
ff49ce0f0d
commit
bad4297952
1 changed files with 9 additions and 2 deletions
|
@ -1953,8 +1953,15 @@ class Connection(ConnectionHandlers):
|
||||||
hostname = gajim.config.get_per('accounts', self.name, 'hostname')
|
hostname = gajim.config.get_per('accounts', self.name, 'hostname')
|
||||||
iq = common.xmpp.Iq(typ = 'set', to = hostname)
|
iq = common.xmpp.Iq(typ = 'set', to = hostname)
|
||||||
iq.setTag(common.xmpp.NS_REGISTER + ' query').setTag('remove')
|
iq.setTag(common.xmpp.NS_REGISTER + ' query').setTag('remove')
|
||||||
con.send(iq)
|
def _on_answer(result):
|
||||||
on_remove_success(True)
|
if result.getType() == 'result':
|
||||||
|
on_remove_success(True)
|
||||||
|
return
|
||||||
|
self.dispatch('ERROR', (_('Unregister failed'),
|
||||||
|
_('Unregistration with server %(server)s failed: %(error)s') \
|
||||||
|
% {'server': hostname, 'error': result.getErrorMsg()}))
|
||||||
|
on_remove_success(False)
|
||||||
|
con.SendAndCallForResponse(iq, _on_answer)
|
||||||
return
|
return
|
||||||
on_remove_success(False)
|
on_remove_success(False)
|
||||||
if self.connected == 0:
|
if self.connected == 0:
|
||||||
|
|
Loading…
Add table
Reference in a new issue