This commit is contained in:
syuilo 2018-04-03 20:09:26 +09:00
parent 78b6f355ad
commit e8e1b8fc58
4 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import create from '../create';
import Resolver from '../resolver';
export default (resolver, actor, activity, distribute) => {
export default (resolver: Resolver, actor, activity, distribute) => {
if ('actor' in activity && actor.account.uri !== activity.actor) {
throw new Error();
}

View File

@ -7,8 +7,9 @@ import queue from '../../../queue';
import context from '../renderer/context';
import renderAccept from '../renderer/accept';
import request from '../../request';
import Resolver from '../resolver';
export default async (resolver, actor, activity, distribute) => {
export default async (resolver: Resolver, actor, activity, distribute) => {
const prefix = config.url + '/@';
const id = activity.object.id || activity.object;

View File

@ -2,8 +2,9 @@ import create from './create';
import follow from './follow';
import undo from './undo';
import createObject from '../create';
import Resolver from '../resolver';
export default (resolver, actor, value, distribute?: boolean) => {
export default (resolver: Resolver, actor, value, distribute?: boolean) => {
return resolver.resolve(value).then(resolved => Promise.all(resolved.map(async promisedResult => {
const result = await promisedResult;
const created = await (await createObject(result.resolver, actor, [result.object], distribute))[0];

View File

@ -1,7 +1,8 @@
import act from '../../act';
import unfollow from './unfollow';
import Resolver from '../../resolver';
export default async (resolver, actor, activity) => {
export default async (resolver: Resolver, actor, activity) => {
if ('actor' in activity && actor.account.uri !== activity.actor) {
throw new Error();
}