投票受信

This commit is contained in:
mei23 2019-01-21 04:03:18 +09:00
parent 520a0b6949
commit 1ddad0d440
1 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import { ITag } from './tag';
import { toUnicode } from 'punycode'; import { toUnicode } from 'punycode';
import { unique, concat, difference } from '../../../prelude/array'; import { unique, concat, difference } from '../../../prelude/array';
import { extractPollFromQuestion } from './question'; import { extractPollFromQuestion } from './question';
import vote from '../../../services/note/polls/vote';
const log = debug('misskey:activitypub'); const log = debug('misskey:activitypub');
@ -111,6 +112,12 @@ export async function createNote(value: any, resolver?: Resolver, silent = false
// テキストのパース // テキストのパース
const text = note._misskey_content ? note._misskey_content : htmlToMFM(note.content); const text = note._misskey_content ? note._misskey_content : htmlToMFM(note.content);
// vote
if (reply && reply.poll && text != null && text.match(/^[0-9]$/)) {
await vote(actor, reply, Number(text));
return null;
}
const emojis = await extractEmojis(note.tag, actor.host).catch(e => { const emojis = await extractEmojis(note.tag, actor.host).catch(e => {
console.log(`extractEmojis: ${e}`); console.log(`extractEmojis: ${e}`);
return [] as IEmoji[]; return [] as IEmoji[];