summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/views/components/poll.vue2
-rw-r--r--src/services/note/create.ts10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/client/app/common/views/components/poll.vue b/src/client/app/common/views/components/poll.vue
index 8817d88cc5..6a9bc786d6 100644
--- a/src/client/app/common/views/components/poll.vue
+++ b/src/client/app/common/views/components/poll.vue
@@ -5,7 +5,7 @@
<div class="backdrop" :style="{ 'width': (showResult ? (choice.votes / total * 100) : 0) + '%' }"></div>
<span>
<template v-if="choice.isVoted"><fa icon="check"/></template>
- <span>{{ choice.text }}</span>
+ <mfm :text="choice.text" :should-break="false" :plain-text="true" :custom-emojis="note.emojis"/>
<span class="votes" v-if="showResult">({{ $t('vote-count').replace('{}', choice.votes) }})</span>
</span>
</li>
diff --git a/src/services/note/create.ts b/src/services/note/create.ts
index 4b9f8215e1..d3c8699b26 100644
--- a/src/services/note/create.ts
+++ b/src/services/note/create.ts
@@ -1,5 +1,5 @@
import es from '../../db/elasticsearch';
-import Note, { pack, INote } from '../../models/note';
+import Note, { pack, INote, IChoice } from '../../models/note';
import User, { isLocalUser, IUser, isRemoteUser, IRemoteUser, ILocalUser } from '../../models/user';
import { publishMainStream, publishHomeTimelineStream, publishLocalTimelineStream, publishHybridTimelineStream, publishGlobalTimelineStream, publishUserListStream, publishHashtagStream } from '../../stream';
import Following from '../../models/following';
@@ -25,7 +25,7 @@ import notesChart from '../../chart/notes';
import perUserNotesChart from '../../chart/per-user-notes';
import activeUsersChart from '../../chart/active-users';
-import { erase } from '../../prelude/array';
+import { erase, concat } from '../../prelude/array';
import insertNoteUnread from './unread';
import registerInstance from '../register-instance';
import Instance from '../../models/instance';
@@ -157,7 +157,11 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
if (!tags || !emojis || !mentionedUsers) {
const tokens = data.text ? parse(data.text) : [];
const cwTokens = data.cw ? parse(data.cw) : [];
- const combinedTokens = tokens.concat(cwTokens);
+ const choiceTokens = data.poll && data.poll.choices
+ ? concat((data.poll.choices as IChoice[]).map(choice => parse(choice.text)))
+ : [];
+
+ const combinedTokens = tokens.concat(cwTokens).concat(choiceTokens);
tags = data.apHashtags || extractHashtags(combinedTokens);