rudeshark.net/src/remote/activitypub/act/undo.ts
2018-04-05 03:21:11 +09:00

16 lines
321 B
TypeScript

import unfollow from './unfollow';
export default async (actor, activity): Promise<void> => {
if ('actor' in activity && actor.account.uri !== activity.actor) {
throw new Error('invalid actor');
}
switch (activity.object.type) {
case 'Follow':
unfollow(actor, activity.object);
break;
}
return null;
};