1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-27 04:59:10 +09:00
misskey/src/remote/activitypub/act/index.ts
2018-04-05 19:19:00 +09:00

34 lines
638 B
TypeScript

import create from './create';
import performDeleteActivity from './delete';
import follow from './follow';
import undo from './undo';
import { IObject } from '../type';
export default async (actor, activity: IObject): Promise<void> => {
switch (activity.type) {
case 'Create':
await create(actor, activity);
break;
case 'Delete':
await performDeleteActivity(actor, activity);
break;
case 'Follow':
await follow(actor, activity);
break;
case 'Accept':
// noop
break;
case 'Undo':
await undo(actor, activity);
break;
default:
console.warn(`unknown activity type: ${activity.type}`);
return null;
}
};