summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0325/control.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-02-12 12:17:01 +0100
committermathieui <mathieui@mathieui.net>2015-02-12 12:17:01 +0100
commitf6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81 (patch)
treeaa566e12ee940d2df17541d5aa53ec38aba162fc /slixmpp/plugins/xep_0325/control.py
parent8b36e918e897a55622c279507a7bc886fdfb1081 (diff)
downloadslixmpp-f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81.tar.gz
slixmpp-f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81.tar.bz2
slixmpp-f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81.tar.xz
slixmpp-f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81.zip
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.
Diffstat (limited to 'slixmpp/plugins/xep_0325/control.py')
-rw-r--r--slixmpp/plugins/xep_0325/control.py12
1 files changed, 6 insertions, 6 deletions
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):
"""