diff options
author | Nikolay Yakimov <root@livid.pp.ru> | 2017-01-23 19:38:02 +0300 |
---|---|---|
committer | Nikolay Yakimov <root@livid.pp.ru> | 2017-01-24 20:34:12 +0300 |
commit | b299827ab5f7b3ba4fe0832d8483be20d4f4a9dd (patch) | |
tree | 2f271204ff9e9ee5951301431e612fd7fd221e55 /gotr | |
parent | a1e8aaefdaf7475dd89dea5f851475844c16add9 (diff) |
[gotr] handle_incoming_msg: set XHTML correctly
In case we get XHTML in OTR message for some reason (e.g. from gajim
0.16.4), we will see that instead of decrypted content, if we don't
delete existing html first.
This doesn't touch old code in handle_outgoing_msg (which will get exectued
gajim<0.16.4). That should work between versions,
given handle_incoming_msg will overwrite any XHTML in
OTR-encrypted message.
Diffstat (limited to 'gotr')
-rw-r--r-- | gotr/otrmodule.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gotr/otrmodule.py b/gotr/otrmodule.py index 72bf190..a61b522 100644 --- a/gotr/otrmodule.py +++ b/gotr/otrmodule.py @@ -607,6 +607,8 @@ class OtrPlugin(GajimPlugin): stripper.feed((msgtxt or '').decode('utf8')) event.msgtxt = stripper.stripped_data event.stanza.setBody(event.msgtxt) + if event.stanza.getXHTML(): + event.stanza.delChild('html') event.stanza.setXHTML((msgtxt or '').decode('utf8')) return PASS |