summaryrefslogtreecommitdiff
path: root/slixmpp/stanza/iq.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/stanza/iq.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/stanza/iq.py')
-rw-r--r--slixmpp/stanza/iq.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/slixmpp/stanza/iq.py b/slixmpp/stanza/iq.py
index e2b3c1f9..c9f29f17 100644
--- a/slixmpp/stanza/iq.py
+++ b/slixmpp/stanza/iq.py
@@ -88,10 +88,10 @@ class Iq(RootStanza):
Overrides StanzaBase.unhandled.
"""
if self['type'] in ('get', 'set'):
- self.reply()
- self['error']['condition'] = 'feature-not-implemented'
- self['error']['text'] = 'No handlers registered for this request.'
- self.send()
+ reply = self.reply()
+ reply['error']['condition'] = 'feature-not-implemented'
+ reply['error']['text'] = 'No handlers registered for this request.'
+ reply.send()
def set_payload(self, value):
"""
@@ -154,9 +154,9 @@ class Iq(RootStanza):
clear -- Indicates if existing content should be
removed before replying. Defaults to True.
"""
- self['type'] = 'result'
- StanzaBase.reply(self, clear)
- return self
+ new_iq = StanzaBase.reply(self, clear=clear)
+ new_iq['type'] = 'result'
+ return new_iq
def send(self, callback=None, timeout=None, timeout_callback=None):
"""Send an <iq> stanza over the XML stream.