fix mentions in replies (#8030)

This commit is contained in:
nullobsi 2021-12-02 03:27:42 -08:00 committed by GitHub
parent bcd188a0e0
commit 3eef0a65c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -289,9 +289,14 @@ export default defineComponent({
if (this.reply && this.reply.text != null) {
const ast = mfm.parse(this.reply.text);
const otherHost = this.reply.user.host;
for (const x of extractMentions(ast)) {
const mention = x.host ? `@${x.username}@${toASCII(x.host)}` : `@${x.username}`;
const mention = x.host ?
`@${x.username}@${toASCII(x.host)}` :
(otherHost == null || otherHost == host) ?
`@${x.username}` :
`@${x.username}@${toASCII(otherHost)}`;
//
if (this.$i.username == x.username && x.host == null) continue;