From 83af9b22566021e0b1cd68743ae658532fd72c31 Mon Sep 17 00:00:00 2001
From: Gabriel Kaszewski
Date: Fri, 15 May 2026 01:12:44 +0200
Subject: [PATCH] feat: show media attachment notice for unsupported post types
(photos/videos)
---
.../adapters/activitypub-base/src/service.rs | 20 ++++++++++++++++++-
thoughts-frontend/components/thought-card.tsx | 8 ++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/crates/adapters/activitypub-base/src/service.rs b/crates/adapters/activitypub-base/src/service.rs
index 4c02646..8e78825 100644
--- a/crates/adapters/activitypub-base/src/service.rs
+++ b/crates/adapters/activitypub-base/src/service.rs
@@ -1587,9 +1587,27 @@ impl domain::ports::FederationActionPort for ActivityPubService {
.ok()?
.with_timezone(&chrono::Utc);
+ let text = note["content"].as_str().unwrap_or("").to_string();
+ let has_attachments = note["attachment"]
+ .as_array()
+ .map(|a| !a.is_empty())
+ .unwrap_or(false);
+
+ let content = if has_attachments {
+ let notice =
+ "📎 Media attachment — not supported
";
+ if text.is_empty() {
+ notice.to_string()
+ } else {
+ format!("{text}{notice}")
+ }
+ } else {
+ text
+ };
+
Some(domain::models::remote_note::RemoteNote {
ap_id: note["id"].as_str()?.to_string(),
- content: note["content"].as_str().unwrap_or("").to_string(),
+ content,
published,
sensitive: note["sensitive"].as_bool().unwrap_or(false),
content_warning: note["summary"].as_str().map(|s| s.to_string()),
diff --git a/thoughts-frontend/components/thought-card.tsx b/thoughts-frontend/components/thought-card.tsx
index 14afd31..29c22a8 100644
--- a/thoughts-frontend/components/thought-card.tsx
+++ b/thoughts-frontend/components/thought-card.tsx
@@ -158,8 +158,12 @@ export function ThoughtCard({
) : (
📎 Media attachment — not supported',
+ }}
/>
)}