diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-05-04 10:19:48 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-05-08 16:20:29 -0400 |
| commit | a4c7f3affdd05bd994223d7d10bd3d45edcbc08e (patch) | |
| tree | b90748b524d99ccb2b4c866fcf9df371812adeb4 /packages/frontend/src/components | |
| parent | resolve mentioned user handles on the backend (diff) | |
| download | sharkey-a4c7f3affdd05bd994223d7d10bd3d45edcbc08e.tar.gz sharkey-a4c7f3affdd05bd994223d7d10bd3d45edcbc08e.tar.bz2 sharkey-a4c7f3affdd05bd994223d7d10bd3d45edcbc08e.zip | |
when replying to a note, auto-fill mentions based on the backend data instead of parsing the OP text
Diffstat (limited to 'packages/frontend/src/components')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 5f4e40d513..59c23b090e 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -316,20 +316,8 @@ if (props.reply && (props.reply.user.username !== $i.username || (props.reply.us text.value = `@${props.reply.user.username}${props.reply.user.host != null ? '@' + toASCII(props.reply.user.host) : ''} `; } -if (props.reply && props.reply.text != null) { - const ast = mfm.parse(props.reply.text); - const otherHost = props.reply.user.host; - - for (const x of extractMentions(ast)) { - const mention = x.host ? - `@${x.username}@${toASCII(x.host)}` : - (otherHost == null || otherHost === host) ? - `@${x.username}` : - `@${x.username}@${toASCII(otherHost)}`; - - // 自分は除外 - if ($i.username === x.username && (x.host == null || x.host === host)) continue; - +if (props.reply && props.reply.mentionHandles) { + for (const mention of Object.values(props.reply.mentionHandles)) { // 重複は除外 if (text.value.includes(`${mention} `)) continue; |