quote must be null or status
This commit is contained in:
parent
4990900390
commit
2a1de51140
|
@ -39,7 +39,7 @@ namespace Entity {
|
|||
language: string | null
|
||||
pinned: boolean | null
|
||||
emoji_reactions: Array<Reaction>
|
||||
quote: boolean
|
||||
quote: Status | null
|
||||
bookmarked: boolean
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
11
megalodon/src/mastodon/entities/reaction.ts
Normal file
11
megalodon/src/mastodon/entities/reaction.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
/// <reference path="account.ts" />
|
||||
|
||||
namespace Entity {
|
||||
export type Reaction = {
|
||||
count: number
|
||||
me: boolean
|
||||
name: string
|
||||
accounts?: Array<Account>
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -56,7 +56,7 @@ const status: Entity.Status = {
|
|||
pinned: null,
|
||||
emoji_reactions: [],
|
||||
bookmarked: false,
|
||||
quote: false
|
||||
quote: null
|
||||
}
|
||||
|
||||
const notification: Entity.Notification = {
|
||||
|
|
|
@ -55,7 +55,7 @@ const status: Entity.Status = {
|
|||
pinned: null,
|
||||
emoji_reactions: [],
|
||||
bookmarked: false,
|
||||
quote: false
|
||||
quote: null
|
||||
}
|
||||
|
||||
const notification: Entity.Notification = {
|
||||
|
|
Loading…
Reference in a new issue