投票はDM
This commit is contained in:
parent
64ff61ce37
commit
594f1af7e7
|
@ -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 ],
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue