summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2018-11-20 13:20:17 +0000
committerMaxime “pep” Buquet <pep@bouah.net>2019-12-27 18:56:27 +0100
commitbab9d1625b27d6622b5566937488172df8e58ba5 (patch)
tree05a55cee0b077e6ee13adee11b2668020248619b /plugins
parentfdf9b74056ce11c3278ddf9ccdcd0d4820ee7afe (diff)
downloadpoezio-bab9d1625b27d6622b5566937488172df8e58ba5.tar.gz
poezio-bab9d1625b27d6622b5566937488172df8e58ba5.tar.bz2
poezio-bab9d1625b27d6622b5566937488172df8e58ba5.tar.xz
poezio-bab9d1625b27d6622b5566937488172df8e58ba5.zip
omemo: catch xep_0384.MissingOwnKey exception
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/omemo_plugin.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/omemo_plugin.py b/plugins/omemo_plugin.py
index 4d3eabec..efd64722 100644
--- a/plugins/omemo_plugin.py
+++ b/plugins/omemo_plugin.py
@@ -15,7 +15,10 @@ import textwrap
from poezio.plugin import BasePlugin
from poezio.tabs import ConversationTab
from poezio.xdg import CACHE_HOME
+from slixmpp.plugins.xep_0384.plugin import MissingOwnKey
+import logging
+log = logging.getLogger(__name__)
class Plugin(BasePlugin):
def init(self):
@@ -122,7 +125,10 @@ class Plugin(BasePlugin):
self.info('Foo2')
if self.xmpp['xep_0384'].is_encrypted(message):
- body = self.xmpp['xep_0384'].decrypt_message(message)
- if body is None: # Message wasn't decrypted
+ try:
+ body = self.xmpp['xep_0384'].decrypt_message(message)
+ except (MissingOwnKey,):
+ log.debug("The following message is missing our key;"
+ "Couldn't decrypt: %r", message)
return None
message['body'] = body.decode("utf8")