Skip to content

Commit

Permalink
Provide contentMap::en such that messages don't all show up on Mastod…
Browse files Browse the repository at this point in the history
…on with a 'translate' option
  • Loading branch information
NuSkooler committed Jan 1, 2024
1 parent c6c457a commit 122b5e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/activitypub/note.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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,
Expand Down

0 comments on commit 122b5e9

Please sign in to comment.