pipeline: fix admin event deletion
This commit is contained in:
parent
c4920ccb2e
commit
e3631104a6
|
@ -88,13 +88,17 @@ async function processDeletions(event: Event): Promise<void> {
|
||||||
if (event.kind === 5) {
|
if (event.kind === 5) {
|
||||||
const ids = getTagSet(event.tags, 'e');
|
const ids = getTagSet(event.tags, 'e');
|
||||||
|
|
||||||
const events = await eventsDB.filter([{
|
if (event.pubkey === Conf.pubkey) {
|
||||||
ids: [...ids],
|
await eventsDB.deleteFilters([{ ids: [...ids] }]);
|
||||||
authors: [Conf.pubkey, event.pubkey],
|
} else {
|
||||||
}]);
|
const events = await eventsDB.filter([{
|
||||||
|
ids: [...ids],
|
||||||
|
authors: [event.pubkey],
|
||||||
|
}]);
|
||||||
|
|
||||||
const deleteIds = events.map(({ id }) => id);
|
const deleteIds = events.map(({ id }) => id);
|
||||||
await eventsDB.deleteFilters([{ ids: deleteIds }]);
|
await eventsDB.deleteFilters([{ ids: deleteIds }]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue