forked from mirror/misskey
投票はDM
This commit is contained in:
parent
64ff61ce37
commit
594f1af7e7
@ -7,6 +7,7 @@ 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';
|
import createNote from '../../../../../services/note/create';
|
||||||
|
import User from '../../../../../models/user';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
desc: {
|
desc: {
|
||||||
@ -118,10 +119,16 @@ export default define(meta, (ps, user) => new Promise(async (res, rej) => {
|
|||||||
|
|
||||||
// リモート投票の場合リプライ送信
|
// リモート投票の場合リプライ送信
|
||||||
if (note._user.host != null) {
|
if (note._user.host != null) {
|
||||||
|
const pollOwner = await User.findOne({
|
||||||
|
_id: note.userId
|
||||||
|
});
|
||||||
|
|
||||||
createNote(user, {
|
createNote(user, {
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
text: ps.choice.toString(),
|
text: ps.choice.toString(),
|
||||||
reply: note,
|
reply: note,
|
||||||
|
visibility: 'specified',
|
||||||
|
visibleUsers: [ pollOwner ],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user