omemo: handle async encryption methods
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
7609a56e48
commit
50833050c7
1 changed files with 7 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue