def requestAuthFields(self): iq = IQRequest("get") q = iq.addElement("query", "jabber:iq:auth") q.addElement("username", content=self.xmlstream.name) d = iq.send(self.xmlstream) d.addCallback(lambda _: self) return d
def provideAuthFields(self): iq = IQRequest("set") iq.addElement("query", "jabber:iq:auth") iq.query.addElement("username", content=self.xmlstream.name) iq.query.addElement("digest", content="9f5e1dbdf5b65451bf6502eeda6eaa359319007c") if hasattr(self.xmlstream, "resource"): iq.query.addElement("resource", content=self.xmlstream.resource) d = iq.send(self.xmlstream) return d pass
def addRoute(self, event, priority=0): iq = IQRequest("set") r = iq.addElement("route", NS_ROUTE) a = r.addElement("add") a.addElement("xpath", content=event.queryStr) a.addElement("priority", content=priority) d = iq.send(self) def success(elm): self.routes[event] = str(elm.route.id) d.addCallback(success)