diff --git a/otr.py b/otr.py index 7f76e09..f426c3f 100644 --- a/otr.py +++ b/otr.py @@ -147,7 +147,8 @@ class OTR(context.Account): text, tlvs = channel.receiveMessage(msgtxt.encode(),appdata=stanza.getThread()) or b'' except (context.UnencryptedMessage,context.NotEncryptedError,context.ErrorReceived,crypt.InvalidParameterError) as e: self.log.error("** got exception while decrypting message: %s" % e) - channel.printl(OTR.STATUS[e].format(msg=msgtxt,err=e.args[0].error)) + status = OTR.STATUS[e.__class__] + channel.printl(status.format(msg=msgtxt,err=e.args[0].error) if len(e.args) > 0 and hasattr(e.args[0], 'error') else status) else: channel.resource = sFrom.resource stanza.setBody(text and text.decode() or "") @@ -169,7 +170,7 @@ class OTR(context.Account): message = (encrypted != self.getDefaultQueryMessage(OTR.DEFAULT_POLICY.get)) and event.message or "" except context.NotEncryptedError as e: self.log.error("** got exception while encrypting message: %s" % e) - channel.printl(peer,OTR.STATUS[e]) + channel.printl(peer,OTR.STATUS[e.__class__]) else: event.msg_iq.setBody(encrypted.decode()) # encrypted data goes here event.message = message # message that will be displayed in our chat goes here diff --git a/plugin-manifest.json b/plugin-manifest.json index 4c6ac3d..c0d5911 100644 --- a/plugin-manifest.json +++ b/plugin-manifest.json @@ -17,5 +17,5 @@ "gajim>=1.6,<1.9" ], "short_name": "otrplugin", - "version": "0.5.2" + "version": "0.5.3" }