summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornullobsi <me@nullob.si>2021-12-02 03:27:42 -0800
committerGitHub <noreply@github.com>2021-12-02 20:27:42 +0900
commit3eef0a65c2a47a696e2a4f35ebd2fde876c71ef5 (patch)
tree31f646f054974593503d62308dddee4f0fb32000
parentenhance(client): make possible to close image dialog with click (diff)
downloadsharkey-3eef0a65c2a47a696e2a4f35ebd2fde876c71ef5.tar.gz
sharkey-3eef0a65c2a47a696e2a4f35ebd2fde876c71ef5.tar.bz2
sharkey-3eef0a65c2a47a696e2a4f35ebd2fde876c71ef5.zip
fix mentions in replies (#8030)
-rw-r--r--packages/client/src/components/post-form.vue7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/client/src/components/post-form.vue b/packages/client/src/components/post-form.vue
index 6f75e12a77..9bad9a84f8 100644
--- a/packages/client/src/components/post-form.vue
+++ b/packages/client/src/components/post-form.vue
@@ -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;