From 89764b09100aa2a1aef51c2d1893dc8a7996f1e2 Mon Sep 17 00:00:00 2001 From: nullobsi Date: Fri, 12 Nov 2021 02:31:56 -0800 Subject: [PATCH] fix: mention local users in replies (#7975) * mention local users in replies * fix merge --- packages/client/src/components/post-form.vue | 4 ++-- packages/client/src/ui/chat/post-form.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue index 6d3cae39b..882a71a37 100644 --- a/packages/client/src/components/post-form.vue +++ b/packages/client/src/components/post-form.vue @@ -278,8 +278,8 @@ export default defineComponent({ this.text += ' '; } - if (this.reply && this.reply.user.host != null) { - this.text = `@${this.reply.user.username}@${toASCII(this.reply.user.host)} `; + if (this.reply && (this.reply.user.username != this.$i.username || (this.reply.user.host != null && this.reply.user.host != host))) { + this.text = `@${this.reply.user.username}${this.reply.user.host != null ? '@' + toASCII(this.reply.user.host) : ''} `; } if (this.reply && this.reply.text != null) { diff --git a/packages/client/src/ui/chat/post-form.vue b/packages/client/src/ui/chat/post-form.vue index 9debee260..62aa3a6aa 100644 --- a/packages/client/src/ui/chat/post-form.vue +++ b/packages/client/src/ui/chat/post-form.vue @@ -206,8 +206,8 @@ export default defineComponent({ this.text += ' '; } - if (this.reply && this.reply.user.host != null) { - this.text = `@${this.reply.user.username}@${toASCII(this.reply.user.host)} `; + if (this.reply && (this.reply.user.username != this.$i.username || (this.reply.user.host != null && this.reply.user.host != host))) { + this.text = `@${this.reply.user.username}${this.reply.user.host != null ? '@' + toASCII(this.reply.user.host) : ''} `; } if (this.reply && this.reply.text != null) {