server: fix wrong emoji regex in backend
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline failed Details
ci/woodpecker/push/test Pipeline failed Details

Changelog: Fixed
This commit is contained in:
Johann150 2024-01-04 17:43:05 +01:00
parent 86565cd25b
commit 3968a6ca07
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 4 additions and 6 deletions

View File

@ -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 };
}