aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime “pep” Buquet2019-10-13 11:31:43 (GMT)
committerMaxime “pep” Buquet2019-12-27 17:58:48 (GMT)
commitc610a76fd9eed3ff86762c44275cb089f85f950e (patch)
treed3147c887d78976007f89b2fdcd561076f8efb00
parent3697e308c29a9470675a7fdba743f2751797ae57 (diff)
downloadpoezio-c610a76fd9eed3ff86762c44275cb089f85f950e.tar.gz
poezio-c610a76fd9eed3ff86762c44275cb089f85f950e.tar.xz
omemo: use dedicated method to check if encryption is enabled
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index 9022231..da6aec9 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -231,7 +231,7 @@ class E2EEPlugin(BasePlugin):
def _toggle_tab(self, _input: str) -> None:
jid = self.api.current_tab().jid # type: JID
- if self._enabled_tabs.get(jid) == self.encrypt:
+ if self._encryption_enabled(jid):
del self._enabled_tabs[jid]
config.remove_and_save('encryption', section=jid)
self.api.information(
@@ -311,7 +311,7 @@ class E2EEPlugin(BasePlugin):
self.store_trust(jid, state, fpr)
def _encryption_enabled(self, jid: JID) -> bool:
- return jid in self._enabled_tabs and self._enabled_tabs[jid] == self.encrypt
+ return self._enabled_tabs.get(jid) == self.encrypt
async def _encrypt_wrapper(self, stanza: StanzaBase) -> Optional[StanzaBase]:
"""