summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/app/desktop/views/components/post-form.vue11
-rw-r--r--src/client/app/mobile/views/components/post-form.vue11
2 files changed, 16 insertions, 6 deletions
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index 0e0848524a..39bec6cf0c 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -116,9 +116,14 @@ export default Vue.extend({
ast.filter(t => t.type == 'mention').forEach(x => {
const mention = x.host ? `@${x.username}@${x.host}` : `@${x.username}`;
- if (this.text.indexOf(`${mention} `) == -1) {
- this.text += `${mention} `;
- }
+
+ // 自分は除外
+ if (this.os.i.username == x.username && x.host == null) return;
+
+ // 重複は除外
+ if (this.text.indexOf(`${mention} `) != -1) return;
+
+ this.text += `${mention} `;
});
}
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue
index 55347b7e53..264eb08448 100644
--- a/src/client/app/mobile/views/components/post-form.vue
+++ b/src/client/app/mobile/views/components/post-form.vue
@@ -84,9 +84,14 @@ export default Vue.extend({
ast.filter(t => t.type == 'mention').forEach(x => {
const mention = x.host ? `@${x.username}@${x.host}` : `@${x.username}`;
- if (this.text.indexOf(`${mention} `) == -1) {
- this.text += `${mention} `;
- }
+
+ // 自分は除外
+ if (this.os.i.username == x.username && x.host == null) return;
+
+ // 重複は除外
+ if (this.text.indexOf(`${mention} `) != -1) return;
+
+ this.text += `${mention} `;
});
}