diff options
-rw-r--r-- | poezio/plugin_e2ee.py | 5 | ||||
-rw-r--r-- | poezio/tabs/basetabs.py | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index 6e0bbc0c..b66a8173 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -257,10 +257,12 @@ class E2EEPlugin(BasePlugin): return "" def _toggle_tab(self, _input: str) -> None: - jid: JID = self.api.current_tab().jid + tab = self.api.current_tab() + jid: JID = tab.jid if self._encryption_enabled(jid): del self._enabled_tabs[jid] + tab.e2e_encryption = None config.remove_and_save('encryption', section=jid) self.api.information( f'{self.encryption_name} encryption disabled for {jid}', @@ -268,6 +270,7 @@ class E2EEPlugin(BasePlugin): ) elif self.encryption_short_name: self._enabled_tabs[jid] = self.encrypt + tab.e2e_encryption = self.encryption_name config.set_and_save('encryption', self.encryption_short_name, section=jid) self.api.information( f'{self.encryption_name} encryption enabled for {jid}', diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 44330782..37dea9c3 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -514,6 +514,7 @@ class ChatTab(Tab): timed_event_paused: Optional[DelayedEvent] timed_event_not_paused: Optional[DelayedEvent] mam_filler: Optional[MAMFiller] + e2e_encryption: Optional[str] = None def __init__(self, core, jid: Union[JID, str]): Tab.__init__(self, core) |