Resolve #1826
This commit is contained in:
parent
c58027e521
commit
864b6ad1bd
8 changed files with 12 additions and 10 deletions
|
@ -39,7 +39,7 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="appearNote.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
<misskey-flavored-markdown v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="appearNote.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<mk-note-header class="header" :note="note" :mini="true"/>
|
<mk-note-header class="header" :note="note" :mini="true"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="note.cw != null" class="cw">
|
<p v-if="note.cw != null" class="cw">
|
||||||
<span class="text" v-if="note.cw != ''">{{ note.cw }}</span>
|
<misskey-flavored-markdown v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="note.cw == null || showContent">
|
<div class="content" v-show="note.cw == null || showContent">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<mk-note-header class="header" :note="note"/>
|
<mk-note-header class="header" :note="note"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="note.cw != null" class="cw">
|
<p v-if="note.cw != null" class="cw">
|
||||||
<span class="text" v-if="note.cw != ''">{{ note.cw }}</span>
|
<misskey-flavored-markdown v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="note.cw == null || showContent">
|
<div class="content" v-show="note.cw == null || showContent">
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<mk-note-header class="header" :note="appearNote" :mini="mini"/>
|
<mk-note-header class="header" :note="appearNote" :mini="mini"/>
|
||||||
<div class="body" v-if="appearNote.deletedAt == null">
|
<div class="body" v-if="appearNote.deletedAt == null">
|
||||||
<p v-if="appearNote.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
<misskey-flavored-markdown v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="appearNote.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</header>
|
</header>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="appearNote.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
<misskey-flavored-markdown v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="appearNote.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<mk-note-header class="header" :note="note" :mini="true"/>
|
<mk-note-header class="header" :note="note" :mini="true"/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<p v-if="note.cw != null" class="cw">
|
<p v-if="note.cw != null" class="cw">
|
||||||
<span class="text" v-if="note.cw != ''">{{ note.cw }}</span>
|
<misskey-flavored-markdown v-if="note.cw != ''" class="text" :text="note.cw" :author="note.user" :i="$store.state.i" :custom-emojis="note.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="note.cw == null || showContent">
|
<div class="content" v-show="note.cw == null || showContent">
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<mk-note-header class="header" :note="appearNote" :mini="true"/>
|
<mk-note-header class="header" :note="appearNote" :mini="true"/>
|
||||||
<div class="body" v-if="appearNote.deletedAt == null">
|
<div class="body" v-if="appearNote.deletedAt == null">
|
||||||
<p v-if="appearNote.cw != null" class="cw">
|
<p v-if="appearNote.cw != null" class="cw">
|
||||||
<span class="text" v-if="appearNote.cw != ''">{{ appearNote.cw }}</span>
|
<misskey-flavored-markdown v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
|
||||||
<mk-cw-button v-model="showContent"/>
|
<mk-cw-button v-model="showContent"/>
|
||||||
</p>
|
</p>
|
||||||
<div class="content" v-show="appearNote.cw == null || showContent">
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
||||||
|
|
|
@ -155,12 +155,14 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
||||||
|
|
||||||
// Parse MFM
|
// Parse MFM
|
||||||
const tokens = data.text ? parse(data.text) : [];
|
const tokens = data.text ? parse(data.text) : [];
|
||||||
|
const cwTokens = data.cw ? parse(data.cw) : [];
|
||||||
|
const combinedTokens = tokens.concat(cwTokens);
|
||||||
|
|
||||||
const tags = extractHashtags(tokens);
|
const tags = extractHashtags(combinedTokens);
|
||||||
|
|
||||||
const emojis = extractEmojis(tokens);
|
const emojis = extractEmojis(combinedTokens);
|
||||||
|
|
||||||
const mentionedUsers = data.apMentions || await extractMentionedUsers(user, tokens);
|
const mentionedUsers = data.apMentions || await extractMentionedUsers(user, combinedTokens);
|
||||||
|
|
||||||
if (data.reply && !user._id.equals(data.reply.userId) && !mentionedUsers.some(u => u._id.equals(data.reply.userId))) {
|
if (data.reply && !user._id.equals(data.reply.userId) && !mentionedUsers.some(u => u._id.equals(data.reply.userId))) {
|
||||||
mentionedUsers.push(await User.findOne({ _id: data.reply.userId }));
|
mentionedUsers.push(await User.findOne({ _id: data.reply.userId }));
|
||||||
|
|
Loading…
Reference in a new issue