Commit 609bfc69 authored by ValdikSS's avatar ValdikSS

Display OMEMO decryption error to the user instead of silently dropping the message

If in Multiuser Conference with OMEMO encryption enabled users
of this group send OMEMO-encrypted messages without encrypting it with
your key, you won't get any visible in-chat notification for this message
and won't know if they send anything at all.

This patch fixes this issue.
parent 13d61751
......@@ -310,14 +310,21 @@ class OMEMOConnection:
plaintext = self.omemo.decrypt_msg(msg_dict)
show_error = False
if not plaintext:
msg.encrypted = 'drop'
if self.omemo.own_device_id not in msg_dict['keys']:
show_error = True
plaintext = 'Received OMEMO-encrypted message does not contain our device key, can\'t decrypt'
msg.encrypted = 'drop'
msg.msgtxt = plaintext
# Gajim bug: there must be a body or the message
# gets dropped from history
if not show_error:
msg.encrypted = self.plugin.encryption_name
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