fix: wire content-warning property for CW text
Updated jf2-to-as2 and compose controller to use the renamed "content-warning" property instead of overloading "summary" for CW text. This pairs with the endpoint-posts fix that renamed the CW form input to prevent collision with the summary field. Confab-Link: http://localhost:8080/sessions/1dcdf030-8015-4d23-89da-b43fd69c7138
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
+9
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user