summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-10-13 13:31:43 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-12-27 18:58:48 +0100
commitc610a76fd9eed3ff86762c44275cb089f85f950e (patch)
treed3147c887d78976007f89b2fdcd561076f8efb00
parent3697e308c29a9470675a7fdba743f2751797ae57 (diff)
downloadpoezio-c610a76fd9eed3ff86762c44275cb089f85f950e.tar.gz
poezio-c610a76fd9eed3ff86762c44275cb089f85f950e.tar.bz2
poezio-c610a76fd9eed3ff86762c44275cb089f85f950e.tar.xz
poezio-c610a76fd9eed3ff86762c44275cb089f85f950e.zip
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 90222313..da6aec9a 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]:
"""