1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 21:26:33 +02:00
This commit is contained in:
syuilo
2018-04-05 01:22:41 +09:00
parent fba46b4c7f
commit eb304cb5fb
8 changed files with 114 additions and 108 deletions

View File

@@ -1,27 +0,0 @@
import act from '../../act';
import deleteObject from '../../delete';
import unfollow from './unfollow';
import Resolver from '../../resolver';
export default async (resolver: Resolver, actor, activity): Promise<void> => {
if ('actor' in activity && actor.account.uri !== activity.actor) {
throw new Error();
}
const results = await act(resolver, actor, activity.object);
await Promise.all(results.map(async promisedResult => {
const result = await promisedResult;
if (result === null || await deleteObject(result) !== null) {
return;
}
switch (result.object.$ref) {
case 'following':
await unfollow(result.object);
}
}));
return null;
};