From f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81 Mon Sep 17 00:00:00 2001 From: mathieui Date: Thu, 12 Feb 2015 12:17:01 +0100 Subject: Fix the uses of stanza.reply() This is relying on the stanzas being copied for each handler. We no longer do that for performance reasons, so instead of editing the copy in-place, stanza.reply() now returns a new stanza. --- slixmpp/plugins/xep_0325/control.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'slixmpp/plugins/xep_0325/control.py') diff --git a/slixmpp/plugins/xep_0325/control.py b/slixmpp/plugins/xep_0325/control.py index e1c16d40..74e067d1 100644 --- a/slixmpp/plugins/xep_0325/control.py +++ b/slixmpp/plugins/xep_0325/control.py @@ -273,7 +273,7 @@ class XEP_0325(BasePlugin): self._threaded_node_request(session, process_fields) else: - iq.reply() + iq = iq.reply() iq['type'] = 'error' iq['setResponse']['responseCode'] = "NotFound" if missing_node is not None: @@ -282,7 +282,7 @@ class XEP_0325(BasePlugin): iq['setResponse'].add_data(missing_field) iq['setResponse']['error']['var'] = "Output" iq['setResponse']['error']['text'] = error_msg - iq.send(block=False) + iq.send() def _handle_direct_set(self, msg): """ @@ -382,7 +382,7 @@ class XEP_0325(BasePlugin): iq['setResponse'].add_node(nodeId) iq['setResponse']['error']['var'] = "Output" iq['setResponse']['error']['text'] = "Timeout." - iq.send(block=False) + iq.send() ## TODO - should we send one timeout per node?? @@ -443,7 +443,7 @@ class XEP_0325(BasePlugin): iq['setResponse'].add_data(error_field) iq['setResponse']['error']['var'] = error_field iq['setResponse']['error']['text'] = error_msg - iq.send(block=False) + iq.send() # Drop communication with this device and check if we are done self.sessions[session]["nodeDone"][nodeId] = True @@ -463,7 +463,7 @@ class XEP_0325(BasePlugin): iq['type'] = "result" iq['id'] = self.sessions[session]['seqnr'] iq['setResponse']['responseCode'] = "OK" - iq.send(block=False) + iq.send() # The session is complete, delete it del self.sessions[session] @@ -526,7 +526,7 @@ class XEP_0325(BasePlugin): iq['set'].add_data(name=name, typename=typename, value=value) self.sessions[seqnr] = {"from": iq['from'], "to": iq['to'], "callback": callback} - iq.send(block=False) + iq.send() def set_command(self, from_jid, to_jid, fields, nodeIds=None): """ -- cgit v1.2.3