[omemo] Show error when message was not encrypted for our device
Fixes #452
This commit is contained in:
@@ -242,9 +242,17 @@ class OMEMO(BaseModule):
|
|||||||
trust = Trust.VERIFIED
|
trust = Trust.VERIFIED
|
||||||
del self._muc_temp_store[properties.omemo.payload]
|
del self._muc_temp_store[properties.omemo.payload]
|
||||||
|
|
||||||
except (DecryptionFailed, MessageNotForDevice):
|
except DecryptionFailed:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
except MessageNotForDevice:
|
||||||
|
plaintext = _('This message was encrypted with OMEMO, '
|
||||||
|
'but not for your device.')
|
||||||
|
# Neither trust nor fingerprint can be verified if we didn't
|
||||||
|
# successfully decrypt the message
|
||||||
|
trust = Trust.UNTRUSTED
|
||||||
|
fingerprint = None
|
||||||
|
|
||||||
prepare_stanza(stanza, plaintext)
|
prepare_stanza(stanza, plaintext)
|
||||||
self._debug_print_stanza(stanza)
|
self._debug_print_stanza(stanza)
|
||||||
properties.encrypted = EncryptionData({'name': ENCRYPTION_NAME,
|
properties.encrypted = EncryptionData({'name': ENCRYPTION_NAME,
|
||||||
|
|||||||
Reference in New Issue
Block a user