when unregistering an account, wait server answer before closing connection.
This commit is contained in:
parent
ff49ce0f0d
commit
bad4297952
|
@ -1953,8 +1953,15 @@ class Connection(ConnectionHandlers):
|
|||
hostname = gajim.config.get_per('accounts', self.name, 'hostname')
|
||||
iq = common.xmpp.Iq(typ = 'set', to = hostname)
|
||||
iq.setTag(common.xmpp.NS_REGISTER + ' query').setTag('remove')
|
||||
con.send(iq)
|
||||
on_remove_success(True)
|
||||
def _on_answer(result):
|
||||
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
|
||||
on_remove_success(False)
|
||||
if self.connected == 0:
|
||||
|
|
Loading…
Reference in New Issue