EventsDB: remove queries for ephemeral kinds

This commit is contained in:
Alex Gleason 2024-07-04 23:38:16 +01:00
parent 5addf58a10
commit 193dd1a011
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -279,6 +279,12 @@ class EventsDB implements NStore {
filter.search = tokens.filter((t) => typeof t === 'string').join(' ');
}
if (filter.kinds) {
// Ephemeral events are not stored, so don't bother querying for them.
// If this results in an empty kinds array, NDatabase will remove the filter before querying and return no results.
filter.kinds = filter.kinds.filter((kind) => !NKinds.ephemeral(kind));
}
}
return filters;