diff --git a/src/common/connection.py b/src/common/connection.py index d58c6aae5..4f8fdf977 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -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: