From 864b6ad1bd59d86364b9f108bd875d17ffd1e2d9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 2 Dec 2018 07:02:08 +0900 Subject: [PATCH] Resolve #1826 --- src/client/app/desktop/views/components/note-detail.vue | 2 +- src/client/app/desktop/views/components/note-preview.vue | 2 +- src/client/app/desktop/views/components/note.sub.vue | 2 +- src/client/app/desktop/views/components/note.vue | 2 +- src/client/app/mobile/views/components/note-detail.vue | 2 +- src/client/app/mobile/views/components/note.sub.vue | 2 +- src/client/app/mobile/views/components/note.vue | 2 +- src/services/note/create.ts | 8 +++++--- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/client/app/desktop/views/components/note-detail.vue b/src/client/app/desktop/views/components/note-detail.vue index 01cde76366..0935866510 100644 --- a/src/client/app/desktop/views/components/note-detail.vue +++ b/src/client/app/desktop/views/components/note-detail.vue @@ -39,7 +39,7 @@

- {{ appearNote.cw }} +

diff --git a/src/client/app/desktop/views/components/note-preview.vue b/src/client/app/desktop/views/components/note-preview.vue index 4c1c7e7b2d..ee4068dd3e 100644 --- a/src/client/app/desktop/views/components/note-preview.vue +++ b/src/client/app/desktop/views/components/note-preview.vue @@ -5,7 +5,7 @@

- {{ note.cw }} +

diff --git a/src/client/app/desktop/views/components/note.sub.vue b/src/client/app/desktop/views/components/note.sub.vue index 5ba22fc76f..05059f2003 100644 --- a/src/client/app/desktop/views/components/note.sub.vue +++ b/src/client/app/desktop/views/components/note.sub.vue @@ -5,7 +5,7 @@

- {{ note.cw }} +

diff --git a/src/client/app/desktop/views/components/note.vue b/src/client/app/desktop/views/components/note.vue index 025d489c09..b87aa5b044 100644 --- a/src/client/app/desktop/views/components/note.vue +++ b/src/client/app/desktop/views/components/note.vue @@ -20,7 +20,7 @@

- {{ appearNote.cw }} +

diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue index 70676c04eb..79eb24189a 100644 --- a/src/client/app/mobile/views/components/note-detail.vue +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -26,7 +26,7 @@

- {{ appearNote.cw }} +

diff --git a/src/client/app/mobile/views/components/note.sub.vue b/src/client/app/mobile/views/components/note.sub.vue index 24f5be160c..37d2879ea3 100644 --- a/src/client/app/mobile/views/components/note.sub.vue +++ b/src/client/app/mobile/views/components/note.sub.vue @@ -5,7 +5,7 @@

- {{ note.cw }} +

diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index 5cfcdc0f3b..b4c98987d0 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -16,7 +16,7 @@

- {{ appearNote.cw }} +

diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 99cf14ecfa..a35e4fe18d 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -155,12 +155,14 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< // Parse MFM 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))) { mentionedUsers.push(await User.findOne({ _id: data.reply.userId }));