From 995590a0f1acff7441859b699160232c420636dd Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 10 Dec 2005 16:23:45 +0000 Subject: [PATCH] don't remove account from Gajim if removal from server failed --- src/common/connection.py | 2 ++ src/config.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/connection.py b/src/common/connection.py index cfff18dab..813a12ee9 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -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''' diff --git a/src/config.py b/src/config.py index 01865046b..b54e57d54 100644 --- a/src/config.py +++ b/src/config.py @@ -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]