Split code
This commit is contained in:
parent
574e3b0bfd
commit
4e9ae8e8d5
6 changed files with 137 additions and 120 deletions
18
src/remote/activitypub/act/delete/index.ts
Normal file
18
src/remote/activitypub/act/delete/index.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import Resolver from '../../resolver';
|
||||
import deleteNote from './note';
|
||||
|
||||
export default async (actor, activity): Promise<void> => {
|
||||
if ('actor' in activity && actor.account.uri !== activity.actor) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
const resolver = new Resolver();
|
||||
|
||||
const object = await resolver.resolve(activity);
|
||||
|
||||
switch (object.type) {
|
||||
case 'Note':
|
||||
deleteNote(object);
|
||||
break;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue