From c590f307129e93e87c0a968dce1d14417ea8a954 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 10 Sep 2018 03:02:06 +0900 Subject: [PATCH] Fix #2596 --- src/client/app/desktop/views/components/post-form.vue | 8 ++++---- src/client/app/mobile/views/components/post-form.vue | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index b2f0954d9..fd489283f 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -63,6 +63,7 @@ import MkVisibilityChooser from '../../../common/views/components/visibility-cho import parse from '../../../../../mfm/parse'; import { host } from '../../../config'; import { erase } from '../../../../../prelude/array'; +import parseAcct from '../../../../../misc/acct/parse'; export default Vue.extend({ components: { @@ -337,10 +338,9 @@ export default Vue.extend({ addVisibleUser() { (this as any).apis.input({ title: '%i18n:@enter-username%' - }).then(username => { - (this as any).api('users/show', { - username - }).then(user => { + }).then(acct => { + if (acct.startsWith('@')) acct = acct.substr(1); + (this as any).api('users/show', parseAcct(acct)).then(user => { this.visibleUsers.push(user); }); }); diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index dcb2f16fa..7e6a4c38e 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -60,6 +60,7 @@ import getFace from '../../../common/scripts/get-face'; import parse from '../../../../../mfm/parse'; import { host } from '../../../config'; import { erase } from '../../../../../prelude/array'; +import parseAcct from '../../../../../misc/acct/parse'; export default Vue.extend({ components: { @@ -253,10 +254,9 @@ export default Vue.extend({ addVisibleUser() { (this as any).apis.input({ title: '%i18n:@username-prompt%' - }).then(username => { - (this as any).api('users/show', { - username - }).then(user => { + }).then(acct => { + if (acct.startsWith('@')) acct = acct.substr(1); + (this as any).api('users/show', parseAcct(acct)).then(user => { this.visibleUsers.push(user); }); });