summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-03-18 19:42:09 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2022-03-23 16:44:27 +0100
commit5caf2587f6a7654b05c1a9a848ea0c3e4cdd9780 (patch)
tree14ee7dfe639f24646e68fe66abee640b570a3e05
parentcb50120d87fa4cc4e1bdf4254c78b7d9c20fee9a (diff)
downloadpoezio-5caf2587f6a7654b05c1a9a848ea0c3e4cdd9780.tar.gz
poezio-5caf2587f6a7654b05c1a9a848ea0c3e4cdd9780.tar.bz2
poezio-5caf2587f6a7654b05c1a9a848ea0c3e4cdd9780.tar.xz
poezio-5caf2587f6a7654b05c1a9a848ea0c3e4cdd9780.zip
chattab: add e2e_encryption property
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py5
-rw-r--r--poezio/tabs/basetabs.py1
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)