async def register(jid, password): metadata = aioxmpp.make_security_layer(None) _, stream, features = await aioxmpp.node.connect_xmlstream(jid, metadata) query = ibr.Query(jid.localpart, password) await ibr.register(stream, query) print("Registered")
async def async_register(self): # pragma: no cover """ Register the agent in the XMPP server from a coroutine. """ metadata = aioxmpp.make_security_layer( None, no_verify=not self.verify_security) query = ibr.Query(self.jid.localpart, self.password) _, stream, features = await aioxmpp.node.connect_xmlstream( self.jid, metadata) await ibr.register(stream, query)
def register(self): # pragma: no cover """ Register the agent in the XMPP server. """ metadata = aioxmpp.make_security_layer( None, no_verify=not self.verify_security) query = ibr.Query(self.jid.localpart, self.password) _, stream, features = self.loop.run_until_complete( aioxmpp.node.connect_xmlstream(self.jid, metadata)) self.loop.run_until_complete(ibr.register(stream, query))