Merge branch 'bugfix/xep_0009' into 'master'
xep-0009: fixed bugs See merge request poezio/slixmpp!172
This commit is contained in:
commit
714f9aae0d
@ -22,7 +22,7 @@ def fault2xml(fault):
|
|||||||
|
|
||||||
def xml2fault(params):
|
def xml2fault(params):
|
||||||
vals = []
|
vals = []
|
||||||
for value in params.xml.findall('{%s}value' % _namespace):
|
for value in params.findall('{%s}value' % _namespace):
|
||||||
vals.append(_xml2py(value))
|
vals.append(_xml2py(value))
|
||||||
fault = dict()
|
fault = dict()
|
||||||
fault['code'] = vals[0]['faultCode']
|
fault['code'] = vals[0]['faultCode']
|
||||||
|
@ -53,8 +53,8 @@ class XEP_0009(BasePlugin):
|
|||||||
|
|
||||||
def make_iq_method_call(self, pto, pmethod, params):
|
def make_iq_method_call(self, pto, pmethod, params):
|
||||||
iq = self.xmpp.make_iq_set()
|
iq = self.xmpp.make_iq_set()
|
||||||
iq.attrib['to'] = pto
|
iq['to'] = pto
|
||||||
iq.attrib['from'] = self.xmpp.boundjid.full
|
iq['from'] = self.xmpp.boundjid.full
|
||||||
iq.enable('rpc_query')
|
iq.enable('rpc_query')
|
||||||
iq['rpc_query']['method_call']['method_name'] = pmethod
|
iq['rpc_query']['method_call']['method_name'] = pmethod
|
||||||
iq['rpc_query']['method_call']['params'] = params
|
iq['rpc_query']['method_call']['params'] = params
|
||||||
@ -62,16 +62,16 @@ class XEP_0009(BasePlugin):
|
|||||||
|
|
||||||
def make_iq_method_response(self, pid, pto, params):
|
def make_iq_method_response(self, pid, pto, params):
|
||||||
iq = self.xmpp.make_iq_result(pid)
|
iq = self.xmpp.make_iq_result(pid)
|
||||||
iq.attrib['to'] = pto
|
iq['to'] = pto
|
||||||
iq.attrib['from'] = self.xmpp.boundjid.full
|
iq['from'] = self.xmpp.boundjid.full
|
||||||
iq.enable('rpc_query')
|
iq.enable('rpc_query')
|
||||||
iq['rpc_query']['method_response']['params'] = params
|
iq['rpc_query']['method_response']['params'] = params
|
||||||
return iq
|
return iq
|
||||||
|
|
||||||
def make_iq_method_response_fault(self, pid, pto, params):
|
def make_iq_method_response_fault(self, pid, pto, params):
|
||||||
iq = self.xmpp.make_iq_result(pid)
|
iq = self.xmpp.make_iq_result(pid)
|
||||||
iq.attrib['to'] = pto
|
iq['to'] = pto
|
||||||
iq.attrib['from'] = self.xmpp.boundjid.full
|
iq['from'] = self.xmpp.boundjid.full
|
||||||
iq.enable('rpc_query')
|
iq.enable('rpc_query')
|
||||||
iq['rpc_query']['method_response']['params'] = None
|
iq['rpc_query']['method_response']['params'] = None
|
||||||
iq['rpc_query']['method_response']['fault'] = params
|
iq['rpc_query']['method_response']['fault'] = params
|
||||||
|
Loading…
x
Reference in New Issue
Block a user