summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-07-11 12:24:15 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2022-07-11 12:24:15 +0200
commit237fd74f7611aa8bc77fa546611f3fc1d8f29a13 (patch)
treede2df1ac0acd699f3c5210d76e93407268fee199
parentbb3cedd57a45f5f87217049f07ef4a43b4ba72e5 (diff)
downloadpoezio-237fd74f7611aa8bc77fa546611f3fc1d8f29a13.tar.gz
poezio-237fd74f7611aa8bc77fa546611f3fc1d8f29a13.tar.bz2
poezio-237fd74f7611aa8bc77fa546611f3fc1d8f29a13.tar.xz
poezio-237fd74f7611aa8bc77fa546611f3fc1d8f29a13.zip
plugin_e2ee: pass on 'own key' information to plugin
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py9
1 files 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.