don't remove account from Gajim if removal from server failed

This commit is contained in:
Yann Leboulanger 2005-12-10 16:23:45 +00:00
parent 408ed03bd0
commit 995590a0f1
2 changed files with 6 additions and 1 deletions

View File

@ -2335,6 +2335,8 @@ class Connection:
iq = common.xmpp.Iq(typ = 'set', to = hostname)
q = iq.setTag(common.xmpp.NS_REGISTER + ' query').setTag('remove')
self.connection.send(iq)
return True
return False
def send_invite(self, room, to, reason=''):
'''sends invitation'''

View File

@ -2187,7 +2187,10 @@ class RemoveAccountWindow:
# We don't remove account cause we canceled pw window
return
gajim.connections[self.account].password = passphrase
gajim.connections[self.account].unregister_account()
if not gajim.connections[self.account].unregister_account():
# unregistration failed, we don't remove the account
# Error message is send by connect_and_auth()
return
# Close all opened windows
gajim.interface.roster.close_all(gajim.interface.instances[self.account])
del gajim.connections[self.account]