From 594f1af7e7e3cd83d5f0340d37df22ba8409f61e Mon Sep 17 00:00:00 2001 From: mei23 Date: Mon, 21 Jan 2019 05:03:09 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A5=A8=E3=81=AFDM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/notes/polls/vote.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts index 78dd1d1ff7..f99fb099c7 100644 --- a/src/server/api/endpoints/notes/polls/vote.ts +++ b/src/server/api/endpoints/notes/polls/vote.ts @@ -7,6 +7,7 @@ import { publishNoteStream } from '../../../../../stream'; import notify from '../../../../../notify'; import define from '../../../define'; import createNote from '../../../../../services/note/create'; +import User from '../../../../../models/user'; export const meta = { desc: { @@ -118,10 +119,16 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { // リモート投票の場合リプライ送信 if (note._user.host != null) { + const pollOwner = await User.findOne({ + _id: note.userId + }); + createNote(user, { createdAt: new Date(), text: ps.choice.toString(), reply: note, + visibility: 'specified', + visibleUsers: [ pollOwner ], }); } }));