mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-30 11:44:25 +01:00
pipeline: fix admin event deletion
This commit is contained in:
@@ -88,13 +88,17 @@ async function processDeletions(event: Event): Promise<void> {
|
||||
if (event.kind === 5) {
|
||||
const ids = getTagSet(event.tags, 'e');
|
||||
|
||||
const events = await eventsDB.filter([{
|
||||
ids: [...ids],
|
||||
authors: [Conf.pubkey, event.pubkey],
|
||||
}]);
|
||||
if (event.pubkey === Conf.pubkey) {
|
||||
await eventsDB.deleteFilters([{ ids: [...ids] }]);
|
||||
} else {
|
||||
const events = await eventsDB.filter([{
|
||||
ids: [...ids],
|
||||
authors: [event.pubkey],
|
||||
}]);
|
||||
|
||||
const deleteIds = events.map(({ id }) => id);
|
||||
await eventsDB.deleteFilters([{ ids: deleteIds }]);
|
||||
const deleteIds = events.map(({ id }) => id);
|
||||
await eventsDB.deleteFilters([{ ids: deleteIds }]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user