parent
3ef6305c76
commit
c033464b92
3 changed files with 34 additions and 2 deletions
16
src/remote/activitypub/kernel/undo/announce.ts
Normal file
16
src/remote/activitypub/kernel/undo/announce.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { Notes } from '../../../../models';
|
||||
import { IRemoteUser } from '../../../../models/entities/user';
|
||||
import { IAnnounce, getApId } from '../../type';
|
||||
import deleteNote from '../../../../services/note/delete';
|
||||
|
||||
export const undoAnnounce = async (actor: IRemoteUser, activity: IAnnounce): Promise<void> => {
|
||||
const uri = getApId(activity);
|
||||
|
||||
const note = await Notes.findOne({
|
||||
uri
|
||||
});
|
||||
|
||||
if (!note) return;
|
||||
|
||||
await deleteNote(actor, note);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue