投票はDM

This commit is contained in:
mei23 2019-01-21 05:03:09 +09:00
parent 64ff61ce37
commit 594f1af7e7
1 changed files with 7 additions and 0 deletions

View File

@ -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 ],
});
}
}));