Commit 97d29bc1 authored by mathieui's avatar mathieui Committed by Maxime Buquet

Fix potential race condition when encrypting

(do not try to rely on the current tab)
parent 0c86e9a5
......@@ -21,7 +21,14 @@ from typing import (
from slixmpp import InvalidJID, JID, Message
from slixmpp.xmlstream import StanzaBase
from poezio.tabs import ConversationTab, DynamicConversationTab, StaticConversationTab, PrivateTab, MucTab
from poezio.tabs import (
ChatTab,
ConversationTab,
DynamicConversationTab,
MucTab,
PrivateTab,
StaticConversationTab,
)
from poezio.plugin import BasePlugin
from asyncio import iscoroutinefunction
......@@ -222,8 +229,8 @@ class E2EEPlugin(BasePlugin):
return stanza
message = stanza
tab = self.api.current_tab()
jid = tab.jid
jid = stanza['to']
tab = self.core.tabs.by_name_and_class(jid, ChatTab)
if not self._encryption_enabled(jid):
return message
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment