plugin OTR: work around a bad exception raised in potr
This commit is contained in:
parent
5bfb675a29
commit
73a4f8d8f6
1 changed files with 5 additions and 1 deletions
|
|
@ -637,7 +637,11 @@ class OTR(object):
|
||||||
next(iter(data["message"].values()))
|
next(iter(data["message"].values()))
|
||||||
) # FIXME: Q&D fix for message refactoring, message is now a dict
|
) # FIXME: Q&D fix for message refactoring, message is now a dict
|
||||||
res = otrctx.receiveMessage(message.encode("utf-8"))
|
res = otrctx.receiveMessage(message.encode("utf-8"))
|
||||||
except potr.context.UnencryptedMessage:
|
except (potr.context.UnencryptedMessage, potr.context.NotOTRMessage):
|
||||||
|
# potr has a bug with Python 3 and test message against str while bytes are
|
||||||
|
# expected, resulting in a NoOTRMessage raised instead of UnencryptedMessage;
|
||||||
|
# so we catch NotOTRMessage as a workaround
|
||||||
|
# TODO: report this upstream
|
||||||
encrypted = False
|
encrypted = False
|
||||||
if otrctx.state == potr.context.STATE_ENCRYPTED:
|
if otrctx.state == potr.context.STATE_ENCRYPTED:
|
||||||
log.warning(
|
log.warning(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue