diff --git a/packages/backend/src/server/api/mastodon/entities/status.ts b/packages/backend/src/server/api/mastodon/entities/status.ts index a6c2a1b74..ce1d5b05b 100644 --- a/packages/backend/src/server/api/mastodon/entities/status.ts +++ b/packages/backend/src/server/api/mastodon/entities/status.ts @@ -55,6 +55,7 @@ namespace MastodonEntity { multiple: boolean }, in_reply_to_id?: string, + quote_id?: string, sensitive?: boolean, spoiler_text?: string, visibility?: string, diff --git a/packages/backend/src/server/api/mastodon/helpers/note.ts b/packages/backend/src/server/api/mastodon/helpers/note.ts index 1bdacd76d..28ca8876e 100644 --- a/packages/backend/src/server/api/mastodon/helpers/note.ts +++ b/packages/backend/src/server/api/mastodon/helpers/note.ts @@ -291,7 +291,8 @@ export class NoteHelpers { ? DriveFiles.findByIds(request.media_ids) : []; - const reply = request.in_reply_to_id ? await getNote(request.in_reply_to_id, user) : undefined; + const reply = request.in_reply_to_id ? await getNote(request.in_reply_to_id, user) : undefined; + const renote = request.quote_id ? await getNote(request.quote_id, user) : undefined; const visibility = request.visibility ?? UserHelpers.getDefaultNoteVisibility(ctx); const data = { @@ -306,6 +307,7 @@ export class NoteHelpers { : undefined, text: request.text, reply: reply, + renote: renote, cw: request.spoiler_text, visibility: visibility, visibleUsers: Promise.resolve(visibility).then(p => p === 'specified' ? this.extractMentions(request.text ?? '', ctx) : undefined) @@ -356,6 +358,8 @@ export class NoteHelpers { result.scheduled_at = new Date(Date.parse(body.scheduled_at)); if (body.in_reply_to_id) result.in_reply_to_id = body.in_reply_to_id; + if (body.quote_id) + result.quote_id = body.quote_id; if (body.media_ids) result.media_ids = body.media_ids && body.media_ids.length > 0 ? toArray(body.media_ids)