rudeshark.net/src/remote/activitypub/act/undo.ts

16 lines
314 B
TypeScript
Raw Normal View History

2018-04-04 18:22:41 +02:00
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(activity.object);
break;
}
return null;
};