From 1ddad0d440cfdad3c950e72a34dc6000222c9a90 Mon Sep 17 00:00:00 2001 From: mei23 Date: Mon, 21 Jan 2019 04:03:18 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A5=A8=E5=8F=97=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/remote/activitypub/models/note.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts index 4ac6507591..d297141745 100644 --- a/src/remote/activitypub/models/note.ts +++ b/src/remote/activitypub/models/note.ts @@ -15,6 +15,7 @@ import { ITag } from './tag'; import { toUnicode } from 'punycode'; import { unique, concat, difference } from '../../../prelude/array'; import { extractPollFromQuestion } from './question'; +import vote from '../../../services/note/polls/vote'; 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); + // 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 => { console.log(`extractEmojis: ${e}`); return [] as IEmoji[];