From fa4ef3b082bdb1a8b574ae9defabc9a0c491241a Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 29 Nov 2025 10:51:00 -0500 Subject: [PATCH] ssb: Show flags on more message type. --- apps/ssb.json | 2 +- apps/ssb/tf-message.js | 41 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 2545ee62..794b911d 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&sMLjk8uV7zNIV2JxHMw6TAYb92hvOafL0+kKWc1Tqt0=.sha256" + "previous": "&E7oElXjP2g+Xb8dhrRyTVdv8EJArjJRvgmfl1prtciw=.sha256" } diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 2abcbeb5..6352530a 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -601,9 +601,11 @@ class TfMessageElement extends LitElement { let self = this; return this.render_frame(html` ${self.render_header()} - ${self.format == 'raw' - ? html`
${self.render_raw()}
` - : inner} +
+ ${self.format == 'raw' + ? html`${self.render_raw()}` + : self.render_flagged(inner)} +
${self.render_votes()} ${(self.message.child_messages || []).map( (x) => html` @@ -729,6 +731,38 @@ class TfMessageElement extends LitElement { : undefined; } + render_flagged(inner) { + if (this.message.flags) { + return html` +
this.toggle_expanded(':cw')} + > +

+ ${this.message.flags + ? html`

+ Caution: This message has been flagged + ${this.message.flags.length} + time${this.message.flags.length == 1 ? '' : 's'}. +

` + : undefined} +

+

+ ${inner !== undefined + ? this.is_expanded(':cw') + ? 'Show less' + : 'Show more' + : undefined} +

+
+ ${this.is_expanded(':cw') ? inner : undefined} + `; + } else { + return inner; + } + } + _render() { let content = this.message?.content; if (this.message?.decrypted?.type == 'post') { @@ -876,6 +910,7 @@ class TfMessageElement extends LitElement { +
${this.render_flagged(undefined)}
${this.render_votes()}
${(this.message.child_messages || []).map( (x) => html`