diff options
-rw-r--r-- | poezio/plugin_e2ee.py | 8 |
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. |