server: fix wrong emoji regex in backend
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/test Pipeline failed
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/test Pipeline failed
Changelog: Fixed
This commit is contained in:
parent
86565cd25b
commit
3968a6ca07
1 changed files with 4 additions and 6 deletions
|
@ -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 };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue