handle XEP-0200 encrypted messages with extra unencrypted bodies

This commit is contained in:
Brendan Taylor 2008-08-01 00:39:40 +00:00
parent 879ceac36c
commit 798c412c85
1 changed files with 5 additions and 0 deletions

View File

@ -281,6 +281,11 @@ class EncryptedStanzaSession(StanzaSession):
return self.encrypter.encrypt(padded)
def decrypt_stanza(self, stanza):
# delete the unencrypted explanation body, if it exists
orig_body = stanza.getTag('body')
if orig_body:
stanza.delChild(orig_body)
c = stanza.getTag(name='c',
namespace='http://www.xmpp.org/extensions/xep-0200.html#ns')