From 19c8590790ac44e29109ffbf3a419b129334852a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 21 Mar 2022 14:14:55 +0100 Subject: plugin_e2ee: Allow /_fingerprint in RosterInfoTab without argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/plugin_e2ee.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index e081cb50..6e0bbc0c 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -31,6 +31,7 @@ from poezio.tabs import ( DynamicConversationTab, MucTab, PrivateTab, + RosterInfoTab, StaticConversationTab, ) from poezio.plugin import BasePlugin @@ -301,8 +302,12 @@ class E2EEPlugin(BasePlugin): @command_args_parser.quoted(0, 1) def _command_show_fingerprints(self, args: List[str]) -> None: - if not args and isinstance(self.api.current_tab(), self.supported_tab_types): - jid = self.api.current_tab().jid + tab = self.api.current_tab() + if not args and isinstance(tab, self.supported_tab_types): + jid = tab.jid + elif not args and isinstance(tab, RosterInfoTab): + # Allow running the command without arguments in roster tab + jid = self.core.xmpp.boundjid.bare elif args: jid = args[0] else: -- cgit v1.2.3