diff src/core/xmpp.py @ 2172:545a1261ac3b

core, plugin XEP-0077: in-band registration fix and move: in-band was partially in core for historical reason, it has been moved to XEP-0077, and fixed. It is still incomplete, but should work for basic accounts creation.
author Goffi <goffi@goffi.org>
date Wed, 08 Mar 2017 20:59:31 +0100
parents 1d3f73e065e1
children f51315500eb1
line wrap: on
line diff
--- a/src/core/xmpp.py	Wed Mar 08 20:44:28 2017 +0100
+++ b/src/core/xmpp.py	Wed Mar 08 20:59:31 2017 +0100
@@ -1090,47 +1090,6 @@
         generic.FallbackHandler.iqFallback(self, iq)
 
 
-class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
-
-    def __init__(self, host, jabber_host, user_login, user_pass, email, deferred, profile):
-        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.deferred = deferred
-        self.profile = profile
-        log.debug(_(u"Registration asked for %(user)s@%(host)s") % {'user': user_login, 'host': jabber_host})
-
-    def connectionMade(self):
-        log.debug(_(u"Connection made with %s" % self.jabber_host))
-        self.xmlstream.namespace = C.NS_CLIENT
-        self.xmlstream.sendHeader()
-
-        iq = xmlstream.IQ(self.xmlstream, 'set')
-        iq["to"] = self.jabber_host
-        query = iq.addElement(('jabber:iq:register', 'query'))
-        _user = query.addElement('username')
-        _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)
-        d = iq.send(self.jabber_host).addCallbacks(self.registrationAnswer, self.registrationFailure)
-        d.chainDeferred(self.deferred)
-
-    def registrationAnswer(self, answer):
-        log.debug(_(u"Registration answer: %s") % answer.toXml())
-        self.xmlstream.sendFooter()
-
-    def registrationFailure(self, failure_):
-        log.info(_("Registration failure: %s") % unicode(failure_.value))
-        self.xmlstream.sendFooter()
-        raise failure_.value
-
-
 class SatVersionHandler(generic.VersionHandler):
 
     def getDiscoInfo(self, requestor, target, node):