Retaining 'id' in the response and error stanzas

This commit is contained in:
Sangeeth Saravanaraj 2015-08-01 17:47:03 +05:30
parent 2c69144189
commit eeab646bfa

View File

@ -127,6 +127,8 @@ class XEP_0332(BasePlugin):
iq['http-resp']['code'] = code iq['http-resp']['code'] = code
iq['http-resp']['message'] = message iq['http-resp']['message'] = message
iq['http-resp']['version'] = '1.1' # TODO: set this implicitly iq['http-resp']['version'] = '1.1' # TODO: set this implicitly
if 'id' in kwargs:
iq['id'] = kwargs["id"]
if data is not None: if data is not None:
iq['http-resp']['data'] = data iq['http-resp']['data'] = data
return iq.send( return iq.send(
@ -145,6 +147,8 @@ class XEP_0332(BasePlugin):
iq['error']['code'] = ecode iq['error']['code'] = ecode
iq['error']['type'] = etype iq['error']['type'] = etype
iq['error']['condition'] = econd iq['error']['condition'] = econd
if 'id' in kwargs:
iq['id'] = kwargs["id"]
return iq.send( return iq.send(
timeout=kwargs.get('timeout', None), timeout=kwargs.get('timeout', None),
block=kwargs.get('block', True), block=kwargs.get('block', True),