From 237fd74f7611aa8bc77fa546611f3fc1d8f29a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 11 Jul 2022 12:24:15 +0200 Subject: plugin_e2ee: pass on 'own key' information to plugin 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, 5 insertions(+), 4 deletions(-) diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index 44d13c51..3f7edd16 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -278,7 +278,7 @@ class E2EEPlugin(BasePlugin): ) @staticmethod - def format_fingerprint(fingerprint: str, theme: Theme) -> str: + def format_fingerprint(fingerprint: str, own: bool, theme: Theme) -> str: return fingerprint async def _show_fingerprints(self, jid: JID) -> None: @@ -286,13 +286,14 @@ class E2EEPlugin(BasePlugin): theme = get_theme() fprs = await self.get_fingerprints(jid) if len(fprs) == 1: - fingerprint = self.format_fingerprint(fprs[0], theme) + fp, own = fprs[0] + fingerprint = self.format_fingerprint(fp, own, theme) self.api.information( f'Fingerprint for {jid}:\n{fingerprint}', 'Info', ) elif fprs: - fmt_fprs = map(lambda fp: self.format_fingerprint(fp, theme), fprs) + fmt_fprs = map(lambda fp: self.format_fingerprint(fp[0], fp[1], theme), fprs) self.api.information( 'Fingerprints for %s:\n%s' % (jid, '\n\n'.join(fmt_fprs)), 'Info', @@ -673,7 +674,7 @@ class E2EEPlugin(BasePlugin): raise NotImplementedError - async def get_fingerprints(self, jid: JID) -> List[str]: + async def get_fingerprints(self, jid: JID) -> List[Tuple[str, bool]]: """Show fingerprint(s) for this encryption method and JID. To overload in plugins. -- cgit v1.2.3