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

16 lines
321 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':
2018-04-04 20:21:11 +02:00
unfollow(actor, activity.object);
2018-04-04 18:22:41 +02:00
break;
}
return null;
};