diff options
author | mathieui <mathieui@mathieui.net> | 2015-02-12 12:17:01 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2015-02-12 12:17:01 +0100 |
commit | f6b3a0c6cffa5ebf10d20c20b5cadd575c91fe81 (patch) | |
tree | aa566e12ee940d2df17541d5aa53ec38aba162fc /slixmpp/stanza/message.py | |
parent | 8b36e918e897a55622c279507a7bc886fdfb1081 (diff) | |
download | slixmpp-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/message.py')
-rw-r--r-- | slixmpp/stanza/message.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/slixmpp/stanza/message.py b/slixmpp/stanza/message.py index 09e44ad8..7f9e90f5 100644 --- a/slixmpp/stanza/message.py +++ b/slixmpp/stanza/message.py @@ -133,21 +133,19 @@ class Message(RootStanza): clear -- Indicates if existing content should be removed before replying. Defaults to True. """ - thread = self['thread'] - parent = self['parent_thread'] + new_message = StanzaBase.reply(self, clear) - StanzaBase.reply(self, clear) if self['type'] == 'groupchat': - self['to'] = self['to'].bare + new_message['to'] = new_message['to'].bare - self['thread'] = thread - self['parent_thread'] = parent + new_message['thread'] = self['thread'] + new_message['parent_thread'] = self['parent_thread'] - del self['id'] + del new_message['id'] if body is not None: - self['body'] = body - return self + new_message['body'] = body + return new_message def get_mucroom(self): """ |