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

16 lines
319 B
TypeScript
Raw Normal View History

2018-04-07 08:54:11 +02:00
import unfollow from './follow';
2018-04-04 18:22:41 +02:00
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':
2018-04-04 20:21:11 +02:00
unfollow(actor, activity.object);
2018-04-04 18:22:41 +02:00
break;
}
return null;
};