summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-01-03 17:25:11 +0100
committermathieui <mathieui@mathieui.net>2015-01-03 17:25:11 +0100
commit44ff71b3a3d79639cb3bc5c592d3d4580bb9ad01 (patch)
tree7601774a592300f48bf5ecef45b5afc437b6b24b /plugins
parentf04728a82b473e4f505d1c4931296e3eab6dbf23 (diff)
downloadpoezio-44ff71b3a3d79639cb3bc5c592d3d4580bb9ad01.tar.gz
poezio-44ff71b3a3d79639cb3bc5c592d3d4580bb9ad01.tar.bz2
poezio-44ff71b3a3d79639cb3bc5c592d3d4580bb9ad01.tar.xz
poezio-44ff71b3a3d79639cb3bc5c592d3d4580bb9ad01.zip
Fix small issues in the OTR plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/otr.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/otr.py b/plugins/otr.py
index 3fc8c65e..38817d89 100644
--- a/plugins/otr.py
+++ b/plugins/otr.py
@@ -595,7 +595,7 @@ class Plugin(BasePlugin):
return
except ErrorReceived as err:
# Received an OTR error
- format_dict['err'] = err.args[0]
+ format_dict['err'] = bytes(err.args[0]).decode('utf-8')
tab.add_message(OTR_ERROR % format_dict, typ=0)
del msg['body']
del msg['html']
@@ -791,7 +791,7 @@ class Plugin(BasePlugin):
del msg['body']
del msg['replace']
del msg['html']
- elif ctx.getPolicy('REQUIRE_ENCRYPTION'):
+ elif ctx and ctx.getPolicy('REQUIRE_ENCRYPTION'):
tab.add_message(MESSAGE_NOT_SENT % format_dict, typ=0)
del msg['body']
del msg['replace']