def _make_register_form(jid, form): iq = Iq('set', Namespace.REGISTER, to=jid) if form.is_fake_form(): query = iq.getTag('query') for field in form.iter_fields(): if field.var == 'fakeform': continue query.addChild(field.var, payload=[field.value]) return iq iq.setQueryPayload(form) return iq
def _make_request(jid, queryid, start, end, with_, after, max_): iq = Iq(typ='set', to=jid, queryNS=Namespace.MAM_2) if queryid is not None: iq.getQuery().setAttr('queryid', queryid) payload = [ _make_query_form(start, end, with_), _make_rsm_query(max_, after) ] iq.setQueryPayload(payload) return iq
def _make_password_change_with_form(domain, form): iq = Iq('set', Namespace.REGISTER, to=domain) iq.setQueryPayload(form) return iq