[mastodon-client] Add support for quote_id parameter when creating posts (#515)
This commit is contained in:
parent
63fa244ea8
commit
e49d168ecd
2 changed files with 6 additions and 1 deletions
|
@ -55,6 +55,7 @@ namespace MastodonEntity {
|
|||
multiple: boolean
|
||||
},
|
||||
in_reply_to_id?: string,
|
||||
quote_id?: string,
|
||||
sensitive?: boolean,
|
||||
spoiler_text?: string,
|
||||
visibility?: string,
|
||||
|
|
|
@ -292,6 +292,7 @@ export class NoteHelpers {
|
|||
: [];
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue