quote must be null or status

This commit is contained in:
cutls 2023-02-23 14:40:22 +09:00 committed by cutestnekoaqua
parent 4990900390
commit 2a1de51140
No known key found for this signature in database
GPG key ID: 6BF0964A5069C1E0
8 changed files with 18 additions and 7 deletions

View file

@ -39,7 +39,7 @@ namespace Entity {
language: string | null
pinned: boolean | null
emoji_reactions: Array<Reaction>
quote: boolean
quote: Status | null
bookmarked: boolean
}
}

View file

@ -627,7 +627,7 @@ namespace MastodonAPI {
emoji_reactions: [],
bookmarked: s.bookmarked ? s.bookmarked : false,
// Now quote is supported only fedibird.com.
quote: s.quote !== undefined && s.quote !== null
quote: s.quote ? status(s.quote) : null
})
export const status_params = (s: Entity.StatusParams): MegalodonEntity.StatusParams => s
export const tag = (t: Entity.Tag): MegalodonEntity.Tag => t

View file

@ -0,0 +1,11 @@
/// <reference path="account.ts" />
namespace Entity {
export type Reaction = {
count: number
me: boolean
name: string
accounts?: Array<Account>
}
}

View file

@ -260,7 +260,7 @@ namespace MisskeyAPI {
pinned: null,
emoji_reactions: mapReactions(n.reactions, n.myReaction),
bookmarked: false,
quote: n.renote !== undefined && n.text !== null
quote: n.renote && n.text ? note(n.renote, host) : null
}
}

View file

@ -234,7 +234,7 @@ namespace PleromaAPI {
pinned: s.pinned,
emoji_reactions: s.pleroma.emoji_reactions ? s.pleroma.emoji_reactions.map(r => reaction(r)) : [],
bookmarked: s.bookmarked ? s.bookmarked : false,
quote: s.reblog !== null && s.reblog.content !== s.content
quote: null
})
export const status_params = (s: Entity.StatusParams): MegalodonEntity.StatusParams => s
export const tag = (t: Entity.Tag): MegalodonEntity.Tag => t

View file

@ -60,7 +60,7 @@ const status: Entity.Status = {
pinned: null,
emoji_reactions: [],
bookmarked: false,
quote: false
quote: null
}
;(axios.CancelToken.source as any).mockImplementation(() => {
return {

View file

@ -56,7 +56,7 @@ const status: Entity.Status = {
pinned: null,
emoji_reactions: [],
bookmarked: false,
quote: false
quote: null
}
const notification: Entity.Notification = {

View file

@ -55,7 +55,7 @@ const status: Entity.Status = {
pinned: null,
emoji_reactions: [],
bookmarked: false,
quote: false
quote: null
}
const notification: Entity.Notification = {