From 122b5e9666c0935d208dcd2c0bde2ea51450745e Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 1 Jan 2024 12:10:21 -0700 Subject: [PATCH] Provide contentMap::en such that messages don't all show up on Mastodon with a 'translate' option --- core/activitypub/note.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/activitypub/note.js b/core/activitypub/note.js index cb751528e..c77fcccd5 100644 --- a/core/activitypub/note.js +++ b/core/activitypub/note.js @@ -126,6 +126,8 @@ module.exports = class Note extends ActivityPubObject { ? 'text/x-ansi' // ye ol' https://lists.freedesktop.org/archives/xdg/2006-March/006214.html : 'text/plain'; + const htmlMessage = messageToHtml(message); + // https://docs.joinmastodon.org/spec/activitypub/#properties-used const obj = { id: ActivityPubObject.makeObjectId('note'), @@ -134,7 +136,11 @@ module.exports = class Note extends ActivityPubObject { to, attributedTo: fromActor.id, summary: message.subject.trim(), - content: messageToHtml(message), + content: htmlMessage, + contentMap: { + en: htmlMessage, // English only, for now + }, + // original message source source: { content: message.message, mediaType: sourceMediaType,