diff src/core/xmpp.py @ 336:953536246d9d

core: added email in registerNewAccount
author Goffi <goffi@goffi.org>
date Wed, 25 May 2011 17:18:05 +0200
parents 698cbc6ebec8
children 9eebdc655b8b
line wrap: on
line diff
--- a/src/core/xmpp.py	Tue May 24 00:56:35 2011 +0200
+++ b/src/core/xmpp.py	Wed May 25 17:18:05 2011 +0200
@@ -236,12 +236,13 @@
 
 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 @@
         _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):