1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 01:45:36 +02:00

user mention (#3771)

This commit is contained in:
MeiMei
2018-12-27 23:14:30 +09:00
committed by syuilo
parent 8573e258f8
commit fdd42fc2d7
11 changed files with 68 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
<mk-post-form ref="form"
:reply="reply"
:renote="renote"
:mention="mention"
:initial-text="initialText"
:instant="instant"
@posted="onPosted"
@@ -27,6 +28,10 @@ export default Vue.extend({
type: Object,
required: false
},
mention: {
type: Object,
required: false
},
initialText: {
type: String,
required: false

View File

@@ -84,6 +84,10 @@ export default Vue.extend({
type: Object,
required: false
},
mention: {
type: Object,
required: false
},
initialText: {
type: String,
required: false
@@ -172,6 +176,11 @@ export default Vue.extend({
this.text = `@${this.reply.user.username}@${toASCII(this.reply.user.host)} `;
}
if (this.mention) {
this.text = this.mention.host ? `@${this.mention.username}@${toASCII(this.mention.host)}` : `@${this.mention.username}`;
this.text += ' ';
}
if (this.reply && this.reply.text != null) {
const ast = parse(this.reply.text);