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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user