From 2d31c670060b90b6db9055a1ac184316c4f9fac1 Mon Sep 17 00:00:00 2001 From: mei23 Date: Mon, 21 Jan 2019 03:28:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=A2=E3=83=BC=E3=83=88=E6=8A=95?= =?UTF-8?q?=E7=A5=A8=E3=81=AE=E5=A0=B4=E5=90=88=E3=83=AA=E3=83=97=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E9=80=81=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/notes/polls/vote.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts index 8de0eb420e..78dd1d1ff7 100644 --- a/src/server/api/endpoints/notes/polls/vote.ts +++ b/src/server/api/endpoints/notes/polls/vote.ts @@ -6,6 +6,7 @@ import watch from '../../../../../services/note/watch'; import { publishNoteStream } from '../../../../../stream'; import notify from '../../../../../notify'; import define from '../../../define'; +import createNote from '../../../../../services/note/create'; export const meta = { desc: { @@ -114,4 +115,13 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => { if (user.settings.autoWatch !== false) { watch(user._id, note); } + + // リモート投票の場合リプライ送信 + if (note._user.host != null) { + createNote(user, { + createdAt: new Date(), + text: ps.choice.toString(), + reply: note, + }); + } }));