comparison sat/plugins/plugin_xep_0077.py @ 3426:8c25489bb79c

plugin XEP-0077: use `xmpp_domain` when set for `host`
author Goffi <goffi@goffi.org>
date Fri, 27 Nov 2020 16:29:06 +0100
parents 77ad87763f32
children be6d91572633
comparison
equal deleted inserted replaced
3425:829fee174606 3426:8c25489bb79c
248 if port: 248 if port:
249 kwargs["port"] = port 249 kwargs["port"] = port
250 return self.registerNewAccount(jid.JID(jid_), password, **kwargs) 250 return self.registerNewAccount(jid.JID(jid_), password, **kwargs)
251 251
252 def registerNewAccount( 252 def registerNewAccount(
253 self, jid_, password, email=None, host="127.0.0.1", port=C.XMPP_C2S_PORT 253 self, jid_, password, email=None, host=None, port=C.XMPP_C2S_PORT
254 ): 254 ):
255 """register a new account on a XMPP server 255 """register a new account on a XMPP server
256 256
257 @param jid_(jid.JID): request jid to register 257 @param jid_(jid.JID): request jid to register
258 @param password(unicode): password of the account 258 @param password(unicode): password of the account
259 @param email(unicode): email of the account 259 @param email(unicode): email of the account
260 @param host(unicode): host of the server to register to 260 @param host(None, unicode): host of the server to register to
261 @param port(int): port of the server to register to 261 @param port(int): port of the server to register to
262 """ 262 """
263 if host is None:
264 host = self.host.memory.getConfig("", "xmpp_domain", "127.0.0.1")
263 check_certificate = host != "127.0.0.1" 265 check_certificate = host != "127.0.0.1"
264 authenticator = RegisteringAuthenticator( 266 authenticator = RegisteringAuthenticator(
265 jid_, password, email, check_certificate=check_certificate) 267 jid_, password, email, check_certificate=check_certificate)
266 registered_d = authenticator.registered 268 registered_d = authenticator.registered
267 server_register = ServerRegister(authenticator) 269 server_register = ServerRegister(authenticator)