From 0827718d6877eba342aba2650ad7a4653fd18ef0 Mon Sep 17 00:00:00 2001
From: Cory McWilliams
Date: Sat, 29 Nov 2025 10:41:08 -0500
Subject: [PATCH] ssb: Un-clobber the flagged message UI. Whoops.
---
apps/ssb.json | 2 +-
apps/ssb/tf-message.js | 51 +++++++++++++++++++++++++++++++++++++-----
2 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/apps/ssb.json b/apps/ssb.json
index 8709e81b..2545ee62 100644
--- a/apps/ssb.json
+++ b/apps/ssb.json
@@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🦀",
- "previous": "&g0o5rMFQcyi3GwyWGrSQcQPPABae0yrUpVehztef3XE=.sha256"
+ "previous": "&sMLjk8uV7zNIV2JxHMw6TAYb92hvOafL0+kKWc1Tqt0=.sha256"
}
diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js
index 7a3afa72..2abcbeb5 100644
--- a/apps/ssb/tf-message.js
+++ b/apps/ssb/tf-message.js
@@ -196,6 +196,26 @@ class TfMessageElement extends LitElement {
);
}
+ flag(event) {
+ let reason = prompt(
+ 'What is the reason for reporting this content (spam, nsfw, ...)?',
+ 'offensive'
+ );
+ if (reason !== undefined) {
+ tfrpc.rpc
+ .appendMessage(this.whoami, {
+ type: 'flag',
+ flag: {
+ link: this.message.id,
+ reason: reason.length ? reason : undefined,
+ },
+ })
+ .catch(function (error) {
+ alert(error?.message);
+ });
+ }
+ }
+
show_image(link) {
let div = document.createElement('div');
div.style.left = 0;
@@ -505,6 +525,12 @@ class TfMessageElement extends LitElement {
>
👍 React
+
${formats.map(
([format, name]) => html`
+
${this.is_expanded(':cw') ? 'Show less' : 'Show more'}
@@ -976,11 +1014,12 @@ class TfMessageElement extends LitElement {
${body}
${this.render_mentions()}
`;
- let payload = content.contentWarning
- ? self.expanded[(this.message.id || '') + ':cw']
- ? html` ${content_warning} ${content_html} `
- : content_warning
- : content_html;
+ let payload =
+ this.message.flags || content.contentWarning
+ ? self.expanded[(this.message.id || '') + ':cw']
+ ? html` ${content_warning} ${content_html} `
+ : content_warning
+ : content_html;
return this.render_frame(html`
${this.render_header()}
${payload}