comparison sat/plugins/plugin_xep_0384.py @ 2754:3bea6b5ae972

plugin XEP-0380, XEP-0384: use C.EXTRA_INFO_DECR_ERR as info sub-type when a message can't be decrypted.
author Goffi <goffi@goffi.org>
date Fri, 04 Jan 2019 18:47:56 +0100
parents ae495f27b316
children 1f612547fb2e
comparison
equal deleted inserted replaced
2753:3dd265d281e1 2754:3bea6b5ae972
989 else: 989 else:
990 post_treat.addCallback(client.encryption.markAsTrusted) 990 post_treat.addCallback(client.encryption.markAsTrusted)
991 except Exception as e: 991 except Exception as e:
992 log.warning(_(u"Can't decrypt message: {reason}\n{xml}").format( 992 log.warning(_(u"Can't decrypt message: {reason}\n{xml}").format(
993 reason=e, xml=message_elt.toXml())) 993 reason=e, xml=message_elt.toXml()))
994 user_msg = (D_(u"An OMEMO message from {sender} can't be decrypted: {reason}")
995 .format(sender=from_jid.full(), reason=e))
996 extra = {C.MESS_EXTRA_INFO: C.EXTRA_INFO_DECR_ERR}
997 client.feedback(from_jid, user_msg, extra)
994 defer.returnValue(False) 998 defer.returnValue(False)
995 if omemo_session.republish_bundle: 999 if omemo_session.republish_bundle:
996 # we don't wait for the Deferred (i.e. no yield) on purpose 1000 # we don't wait for the Deferred (i.e. no yield) on purpose
997 # there is no need to block the whole message workflow while 1001 # there is no need to block the whole message workflow while
998 # updating the bundle 1002 # updating the bundle