show correct error message when we fail to create an account. See #1725

This commit is contained in:
Yann Leboulanger 2006-03-26 23:42:36 +00:00
parent 6a44733d69
commit bdda6d1555
2 changed files with 3 additions and 3 deletions

View File

@ -168,8 +168,8 @@ class Connection(ConnectionHandlers):
req['username'] = self.new_account_info['name'] req['username'] = self.new_account_info['name']
req['password'] = self.new_account_info['password'] req['password'] = self.new_account_info['password']
def _on_register_result(result): def _on_register_result(result):
if not result: if not common.xmpp.isResultNode(result):
self.dispatch('ACC_NOT_OK', (self.connection.lastErr)) self.dispatch('ACC_NOT_OK', (result.getError()))
return return
self.connected = 0 self.connected = 0
self.password = self.new_account_info['password'] self.password = self.new_account_info['password']

View File

@ -149,7 +149,7 @@ def register(disp, host, info, cb):
info=info.asDict() info=info.asDict()
for i in info.keys(): for i in info.keys():
iq.setTag('query').setTagData(i,info[i]) iq.setTag('query').setTagData(i,info[i])
_on_default_response(disp, iq, cb) disp.SendAndCallForResponse(iq, cb)
def unregister(disp, host, cb): def unregister(disp, host, cb):
""" Unregisters with host (permanently removes account). """ Unregisters with host (permanently removes account).