summaryrefslogtreecommitdiff
path: root/slixmpp/plugins/xep_0047
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_0047
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_0047')
-rw-r--r--slixmpp/plugins/xep_0047/ibb.py3
-rw-r--r--slixmpp/plugins/xep_0047/stream.py6
2 files changed, 3 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0047/ibb.py b/slixmpp/plugins/xep_0047/ibb.py
index ce697f01..7c01c78a 100644
--- a/slixmpp/plugins/xep_0047/ibb.py
+++ b/slixmpp/plugins/xep_0047/ibb.py
@@ -191,8 +191,7 @@ class XEP_0047(BasePlugin):
self.window_size)
stream.stream_started.set()
self.api['set_stream'](stream.self_jid, stream.sid, stream.peer_jid, stream)
- iq.reply()
- iq.send()
+ iq.reply().send()
self.xmpp.event('ibb_stream_start', stream)
self.xmpp.event('stream:%s:%s' % (sid, stream.peer_jid), stream)
diff --git a/slixmpp/plugins/xep_0047/stream.py b/slixmpp/plugins/xep_0047/stream.py
index a8e7ff2a..ba0b2cec 100644
--- a/slixmpp/plugins/xep_0047/stream.py
+++ b/slixmpp/plugins/xep_0047/stream.py
@@ -103,8 +103,7 @@ class IBBytestream(object):
self.xmpp.event('ibb_stream_data', {'stream': self, 'data': data})
if isinstance(stanza, Iq):
- stanza.reply()
- stanza.send()
+ stanza.reply().send()
def recv(self, *args, **kwargs):
return self.read(block=True)
@@ -134,8 +133,7 @@ class IBBytestream(object):
def _closed(self, iq):
self.stream_in_closed.set()
self.stream_out_closed.set()
- iq.reply()
- iq.send()
+ iq.reply().send()
self.xmpp.event('ibb_stream_end', self)
def makefile(self, *args, **kwargs):