diff --git a/packages/backend/src/misc/populate-emojis.ts b/packages/backend/src/misc/populate-emojis.ts index f0a168369..ef53b8c5e 100644 --- a/packages/backend/src/misc/populate-emojis.ts +++ b/packages/backend/src/misc/populate-emojis.ts @@ -44,12 +44,10 @@ function normalizeHost(src: string | undefined, noteUserHost: string | null): st } function parseEmojiStr(emojiName: string, noteUserHost: string | null) { - const match = emojiName.match(/^(\w+)(?:@([\w.-]+))?$/); - if (!match) return { name: null, host: null }; - - const name = match[1]; - - const host = toPunyNullable(normalizeHost(match[2], noteUserHost)); + // emojiName may be of the form `emoji@host`, turn it into a suitable form + const match = emojiName.split("@"); + const name = match[0]; + const host = toPunyNullable(normalizeHost(match[1], noteUserHost)); return { name, host }; }