comparison sat/plugins/plugin_sec_otr.py @ 2726:a86f494457c2

plugin OTR: catch and log potr.context.ErrorReceived instead of raising it.
author Goffi <goffi@goffi.org>
date Wed, 26 Dec 2018 17:18:52 +0100
parents c26492bd2144
children da59ff099b32
comparison
equal deleted inserted replaced
2725:d0466af33483 2726:a86f494457c2
589 ), 589 ),
590 ) 590 )
591 client.feedback(from_jid, feedback) 591 client.feedback(from_jid, feedback)
592 except potr.context.NotEncryptedError: 592 except potr.context.NotEncryptedError:
593 msg = D_(u"WARNING: received OTR encrypted data in an unencrypted context") 593 msg = D_(u"WARNING: received OTR encrypted data in an unencrypted context")
594 log.warning(msg)
595 feedback = msg
596 client.feedback(from_jid, msg)
597 raise failure.Failure(exceptions.CancelError(msg))
598 except potr.context.ErrorReceived as e:
599 msg = D_(u"WARNING: received OTR error message: {msg}".format(msg=e))
594 log.warning(msg) 600 log.warning(msg)
595 feedback = msg 601 feedback = msg
596 client.feedback(from_jid, msg) 602 client.feedback(from_jid, msg)
597 raise failure.Failure(exceptions.CancelError(msg)) 603 raise failure.Failure(exceptions.CancelError(msg))
598 except StopIteration: 604 except StopIteration: