core: added email in registerNewAccount

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

View file

@ -265,11 +265,11 @@ class SAT(service.Service):
return None
return self.profiles[profile]
def registerNewAccount(self, login, password, server, port = 5222, id = None):
def registerNewAccount(self, login, password, email, server, port = 5222, id = None):
"""Connect to a server and create a new account using in-band registration"""
next_id = id or sat_next_id() #the id is used to send server's answer
serverRegistrer = xmlstream.XmlStreamFactory(xmpp.RegisteringAuthenticator(self, server, login, password, next_id))
serverRegistrer = xmlstream.XmlStreamFactory(xmpp.RegisteringAuthenticator(self, server, login, password, email, next_id))
connector = reactor.connectTCP(server, port, serverRegistrer)
serverRegistrer.clientConnectionLost = lambda conn, reason: connector.disconnect()
@ -304,7 +304,7 @@ class SAT(service.Service):
user = jid.parse(self.memory.getParamA("JabberID", "Connection", profile_key=profile))[0]
password = self.memory.getParamA("Password", "Connection", profile_key=profile)
server = self.memory.getParamA("Server", "Connection", profile_key=profile)
self.registerNewAccount(user, password, server, id=action_id)
self.registerNewAccount(user, password, None, server, id=action_id)
else:
self.actionResult(action_id, "SUPPRESS", {})