mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
Mastodon API: convert reaction accounts
This commit is contained in:
parent
4ebda2cae6
commit
df3f2d2b5e
1 changed files with 7 additions and 0 deletions
|
@ -38,6 +38,12 @@ export function convertNotification(notification: Entity.Notification) {
|
|||
export function convertPoll(poll: Entity.Poll) {
|
||||
return simpleConvert(poll);
|
||||
}
|
||||
export function convertReaction(reaction: Entity.Reaction) {
|
||||
if (reaction.accounts) {
|
||||
reaction.accounts = reaction.accounts.map(convertAccount);
|
||||
}
|
||||
return reaction;
|
||||
}
|
||||
export function convertRelationship(relationship: Entity.Relationship) {
|
||||
return simpleConvert(relationship);
|
||||
}
|
||||
|
@ -61,6 +67,7 @@ export function convertStatus(status: Entity.Status) {
|
|||
}));
|
||||
if (status.poll) status.poll = convertPoll(status.poll);
|
||||
if (status.reblog) status.reblog = convertStatus(status.reblog);
|
||||
status.emoji_reactions = status.mentions.map(convertReaction);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue