core: added email in registerNewAccount

This commit is contained in:
Goffi 2011-05-25 17:18:05 +02:00
commit 138f0b26da

View file

@ -236,12 +236,13 @@ class SatFallbackHandler(generic.FallbackHandler):
class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
def __init__(self, host, jabber_host, user_login, user_pass, answer_id):
def __init__(self, host, jabber_host, user_login, user_pass, email, answer_id):
xmlstream.ConnectAuthenticator.__init__(self, jabber_host)
self.host = host
self.jabber_host = jabber_host
self.user_login = user_login
self.user_pass = user_pass
self.user_email = email
self.answer_id = answer_id
print _("Registration asked for"),user_login, user_pass, jabber_host
@ -258,6 +259,10 @@ class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
_user.addContent(self.user_login)
_pass = query.addElement('password')
_pass.addContent(self.user_pass)
if self.user_email:
_email = query.addElement('email')
_email.addContent(self.user_email)
print iq.toXml()
reg = iq.send(self.jabber_host).addCallbacks(self.registrationAnswer, self.registrationFailure)
def registrationAnswer(self, answer):