summaryrefslogtreecommitdiff
path: root/src/core/commands.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-06-21 17:03:28 +0200
committermathieui <mathieui@mathieui.net>2015-06-21 17:03:28 +0200
commit0627a85483ae9e1dc8e90561202691fda3020026 (patch)
tree55449f3045a38cf76b19071c4c6495564e10f11e /src/core/commands.py
parentce53874927787006c6a6a14d590eef3769dd65b7 (diff)
downloadpoezio-0627a85483ae9e1dc8e90561202691fda3020026.tar.gz
poezio-0627a85483ae9e1dc8e90561202691fda3020026.tar.bz2
poezio-0627a85483ae9e1dc8e90561202691fda3020026.tar.xz
poezio-0627a85483ae9e1dc8e90561202691fda3020026.zip
Fix #3051 (always add an id attribute to rawxml IQ set/get)
Diffstat (limited to 'src/core/commands.py')
-rw-r--r--src/core/commands.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/commands.py b/src/core/commands.py
index 2f5147c0..341e0abb 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -896,10 +896,11 @@ def command_rawxml(self, args):
stanza = args
try:
stanza = StanzaBase(self.xmpp, xml=ET.fromstring(stanza))
- if stanza.xml.tag == 'iq' and \
- stanza.xml.attrib.get('type') in ('get', 'set') and \
- stanza.xml.attrib.get('id'):
+ if stanza.xml.tag == 'iq' and stanza.xml.attrib.get('type') in ('get', 'set'):
iq_id = stanza.xml.attrib.get('id')
+ if not iq_id:
+ iq_id = self.xmpp.new_id()
+ stanza['id'] = iq_id
def iqfunc(iq):
"handler for an iq reply"