# HG changeset patch # User Goffi # Date 1546624076 -3600 # Node ID 3bea6b5ae97283ab3228abec1c9aedc6e2279643 # Parent 3dd265d281e1580fe428ed2a41b897135e375499 plugin XEP-0380, XEP-0384: use C.EXTRA_INFO_DECR_ERR as info sub-type when a message can't be decrypted. diff -r 3dd265d281e1 -r 3bea6b5ae972 sat/plugins/plugin_xep_0380.py --- a/sat/plugins/plugin_xep_0380.py Fri Jan 04 18:46:39 2019 +0100 +++ b/sat/plugins/plugin_xep_0380.py Fri Jan 04 18:47:56 2019 +0100 @@ -96,6 +96,6 @@ u"User {sender} sent you an encrypted message (encrypted with {algorithm}), " u"and we can't decrypt it.").format(sender=sender_s, algorithm=algorithm) - extra = {C.MESS_EXTRA_INFO: u"UNKNOWN_ENCRYPTION"} + extra = {C.MESS_EXTRA_INFO: C.EXTRA_INFO_DECR_ERR} client.feedback(to_jid, user_msg, extra) return False diff -r 3dd265d281e1 -r 3bea6b5ae972 sat/plugins/plugin_xep_0384.py --- a/sat/plugins/plugin_xep_0384.py Fri Jan 04 18:46:39 2019 +0100 +++ b/sat/plugins/plugin_xep_0384.py Fri Jan 04 18:47:56 2019 +0100 @@ -991,6 +991,10 @@ except Exception as e: log.warning(_(u"Can't decrypt message: {reason}\n{xml}").format( reason=e, xml=message_elt.toXml())) + user_msg = (D_(u"An OMEMO message from {sender} can't be decrypted: {reason}") + .format(sender=from_jid.full(), reason=e)) + extra = {C.MESS_EXTRA_INFO: C.EXTRA_INFO_DECR_ERR} + client.feedback(from_jid, user_msg, extra) defer.returnValue(False) if omemo_session.republish_bundle: # we don't wait for the Deferred (i.e. no yield) on purpose