From 607e9ef71b17ff3baaae378a879a3c971c024d95 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 8 Nov 2023 01:43:58 +0000 Subject: [PATCH] Show more information about encrypted messages. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4618 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- apps/ssb.json | 2 +- apps/ssb/tf-message.js | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 85c72fa4e..5c4dddc20 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🐌", - "previous": "&rMCwJnENRN/cYxMPF06+r0dlKVyFFuL3fziFjG14oN4=.sha256" + "previous": "&eHrt88ylDUCaDFIj3DTdUaHPYQRe81K//O80CHp+pyk=.sha256" } \ No newline at end of file diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index ac1fcf698..1f780d429 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -258,9 +258,16 @@ class TfMessageElement extends LitElement { case 'md': raw_button = html` self.format = 'message'}>`; break; - default: + case 'decrypted': raw_button = html` self.format = 'raw'}>`; break; + default: + if (this.message.decrypted) { + raw_button = html` self.format = 'decrypted'}>`; + } else { + raw_button = html` self.format = 'raw'}>`; + } + break; } function small_frame(inner) { let body; @@ -526,7 +533,11 @@ class TfMessageElement extends LitElement { `); } else if (typeof(this.message.content) == 'string') { if (this.message?.decrypted) { - return small_frame(html`🔓
${JSON.stringify(this.decrypted, null, 2)}
`); + if (this.format == 'decrypted') { + return small_frame(html`🔓
${JSON.stringify(this.message.decrypted, null, 2)}
`); + } else { + return small_frame(html`🔓
${this.message.decrypted.type}
`); + } } else { return small_frame(html`🔒`); }