emoji fallback
This commit is contained in:
parent
1bc145678b
commit
e1ab3206a6
@ -62,7 +62,7 @@ export async function populateEmoji(emojiName: string, noteUserHost: string | nu
|
|||||||
if (emoji == null) return null;
|
if (emoji == null) return null;
|
||||||
|
|
||||||
const isLocal = emoji.host == null;
|
const isLocal = emoji.host == null;
|
||||||
const url = isLocal ? emoji.publicUrl : `${config.url}/proxy/image.png?${query({ url: emoji.publicUrl })}`;
|
const url = isLocal ? emoji.publicUrl || emoji.originalUrl : `${config.url}/proxy/image.png?${query({ url: emoji.publicUrl || emoji.originalUrl })}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: emojiName,
|
name: emojiName,
|
||||||
|
@ -9,6 +9,6 @@ export default (emoji: Emoji) => ({
|
|||||||
icon: {
|
icon: {
|
||||||
type: 'Image',
|
type: 'Image',
|
||||||
mediaType: emoji.type || 'image/png',
|
mediaType: emoji.type || 'image/png',
|
||||||
url: emoji.publicUrl,
|
url: emoji.publicUrl || emoji.originalUrl,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -88,7 +88,7 @@ export default async (user: { id: User['id']; host: User['host']; }, note: Note,
|
|||||||
reaction: decodedReaction.reaction,
|
reaction: decodedReaction.reaction,
|
||||||
emoji: emoji != null ? {
|
emoji: emoji != null ? {
|
||||||
name: emoji.host ? `${emoji.name}@${emoji.host}` : `${emoji.name}@.`,
|
name: emoji.host ? `${emoji.name}@${emoji.host}` : `${emoji.name}@.`,
|
||||||
url: emoji.publicUrl ?? emoji.originalUrl,
|
url: emoji.publicUrl || emoji.originalUrl,
|
||||||
} : null,
|
} : null,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user