comparison sat/plugins/plugin_xep_0384.py @ 2859:4e875d9eea48

plugin XEP-0384: give feedback to client when encryption failed
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:08:47 +0100
parents 31a5038cdf79
children 851c47cc4ae7
comparison
equal deleted inserted replaced
2858:31a5038cdf79 2859:4e875d9eea48
889 problems=e.problems) 889 problems=e.problems)
890 loop_idx += 1 890 loop_idx += 1
891 else: 891 else:
892 break 892 break
893 except Exception as e: 893 except Exception as e:
894 log.warning( 894 msg = _(u"Can't encrypt message for {entity}: {reason}".format(
895 _(u"Can't encrypt message for {entity}: {reason}".format( 895 entity=entity_bare_jid.full(), reason=str(e).decode('utf-8', 'replace')))
896 entity=entity_bare_jid.full(), reason=str(e).decode('utf-8', 'replace')))) 896 log.warning(msg)
897 extra = {C.MESS_EXTRA_INFO: C.EXTRA_INFO_ENCR_ERR}
898 client.feedback(entity_bare_jid, msg, extra)
897 raise e 899 raise e
898 900
899 defer.returnValue(encrypted) 901 defer.returnValue(encrypted)
900 902
901 @defer.inlineCallbacks 903 @defer.inlineCallbacks