[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.
parent a1e8aaef
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment