show correct error message when we fail to create an account. See #1725
This commit is contained in:
parent
6a44733d69
commit
bdda6d1555
|
@ -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']
|
||||||
|
|
|
@ -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).
|
||||||
|
|
Loading…
Reference in New Issue