summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-08-22 22:18:58 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-12-27 18:57:33 +0100
commit50833050c777b08f08d2fd22a19987814b8634eb (patch)
treecaecb516a56c49fce5da266471ce78eaf5c41e9a
parent7609a56e4820906efee6792bbee12267060ef6c0 (diff)
downloadpoezio-50833050c777b08f08d2fd22a19987814b8634eb.tar.gz
poezio-50833050c777b08f08d2fd22a19987814b8634eb.tar.bz2
poezio-50833050c777b08f08d2fd22a19987814b8634eb.tar.xz
poezio-50833050c777b08f08d2fd22a19987814b8634eb.zip
omemo: handle async encryption methods
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index e626f3ab..624a36f2 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -24,6 +24,8 @@ from slixmpp.xmlstream import StanzaBase
from poezio.tabs import ConversationTab, DynamicConversationTab, StaticConversationTab, PrivateTab, MucTab
from poezio.plugin import BasePlugin
+from asyncio import iscoroutinefunction
+
import logging
log = logging.getLogger(__name__)
@@ -241,7 +243,11 @@ class E2EEPlugin(BasePlugin):
return None
# Call the enabled encrypt method
- self._enabled_tabs[jid](message, tab)
+ func = self._enabled_tabs[jid]
+ if iscoroutinefunction(func):
+ await func(message, tab)
+ else:
+ func(message, tab)
if has_body:
# Only add EME tag if the message has a body.