diff --git a/lib/controllers/compose.js b/lib/controllers/compose.js index d3e4c5e..ea8135b 100644 --- a/lib/controllers/compose.js +++ b/lib/controllers/compose.js @@ -216,7 +216,7 @@ export function submitComposeController(mountPath, plugin) { } if (cwEnabled && summary && summary.trim()) { - micropubData.append("summary", summary.trim()); + micropubData.append("content-warning", summary.trim()); micropubData.append("sensitive", "true"); } diff --git a/lib/jf2-to-as2.js b/lib/jf2-to-as2.js index c87726e..a5a22c2 100644 --- a/lib/jf2-to-as2.js +++ b/lib/jf2-to-as2.js @@ -171,6 +171,12 @@ export function jf2ToActivityStreams(properties, actorUrl, publicationUrl, optio object.sensitive = true; } + // Content warning text for Mastodon CW display + if (properties["content-warning"]) { + object.summary = properties["content-warning"]; + object.sensitive = true; + } + if (properties["in-reply-to"]) { object.inReplyTo = properties["in-reply-to"]; } @@ -337,9 +343,9 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl, options = if (properties["post-status"] === "sensitive") { noteOptions.sensitive = true; } - // Summary doubles as CW text in Mastodon (notes only — articles already use summary for description) - if (properties.summary && !isArticle) { - noteOptions.summary = properties.summary; + // Content warning text for Mastodon CW display + if (properties["content-warning"]) { + noteOptions.summary = properties["content-warning"]; noteOptions.sensitive = true; } diff --git a/package.json b/package.json index 42de7b9..cce331b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "2.15.3", + "version": "2.15.4", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",