リモート投票の場合リプライ送信

This commit is contained in:
mei23 2019-01-21 03:28:03 +09:00
parent b7a6699c35
commit 2d31c67006
1 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import watch from '../../../../../services/note/watch';
import { publishNoteStream } from '../../../../../stream'; import { publishNoteStream } from '../../../../../stream';
import notify from '../../../../../notify'; import notify from '../../../../../notify';
import define from '../../../define'; import define from '../../../define';
import createNote from '../../../../../services/note/create';
export const meta = { export const meta = {
desc: { desc: {
@ -114,4 +115,13 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
if (user.settings.autoWatch !== false) { if (user.settings.autoWatch !== false) {
watch(user._id, note); watch(user._id, note);
} }
// リモート投票の場合リプライ送信
if (note._user.host != null) {
createNote(user, {
createdAt: new Date(),
text: ps.choice.toString(),
reply: note,
});
}
})); }));