From bdda6d1555ec3ba3ed5fa2c61f18d62dab7fb415 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 26 Mar 2006 23:42:36 +0000 Subject: [PATCH] show correct error message when we fail to create an account. See #1725 --- src/common/connection.py | 4 ++-- src/common/xmpp/features_nb.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index bcd2b3fda..78f2e3a36 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -168,8 +168,8 @@ class Connection(ConnectionHandlers): req['username'] = self.new_account_info['name'] req['password'] = self.new_account_info['password'] def _on_register_result(result): - if not result: - self.dispatch('ACC_NOT_OK', (self.connection.lastErr)) + if not common.xmpp.isResultNode(result): + self.dispatch('ACC_NOT_OK', (result.getError())) return self.connected = 0 self.password = self.new_account_info['password'] diff --git a/src/common/xmpp/features_nb.py b/src/common/xmpp/features_nb.py index 6f4a7326d..85fb63985 100644 --- a/src/common/xmpp/features_nb.py +++ b/src/common/xmpp/features_nb.py @@ -149,7 +149,7 @@ def register(disp, host, info, cb): info=info.asDict() for i in info.keys(): iq.setTag('query').setTagData(i,info[i]) - _on_default_response(disp, iq, cb) + disp.SendAndCallForResponse(iq, cb) def unregister(disp, host, cb): """ Unregisters with host (permanently removes account).