summaryrefslogtreecommitdiff
path: root/slixmpp/stanza/presence.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/presence.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/presence.py')
-rw-r--r--slixmpp/stanza/presence.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/slixmpp/stanza/presence.py b/slixmpp/stanza/presence.py
index 2c77a878..e1b8c0bc 100644
--- a/slixmpp/stanza/presence.py
+++ b/slixmpp/stanza/presence.py
@@ -174,8 +174,9 @@ class Presence(RootStanza):
clear -- Indicates if the stanza contents should be removed
before replying. Defaults to True.
"""
+ new_presence = StanzaBase.reply(self, clear)
if self['type'] == 'unsubscribe':
- self['type'] = 'unsubscribed'
+ new_presence['type'] = 'unsubscribed'
elif self['type'] == 'subscribe':
- self['type'] = 'subscribed'
- return StanzaBase.reply(self, clear)
+ new_presence['type'] = 'subscribed'
+ return new_presence