db/events: simplify it further
This commit is contained in:
parent
b39902d322
commit
f6a8ab570f
|
@ -155,11 +155,9 @@ function getFilterQuery(filter: DittoFilter): EventQuery {
|
|||
}
|
||||
|
||||
if (typeof filter.local === 'boolean') {
|
||||
query = filter.local
|
||||
? query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
||||
.where('users.d_tag', 'is not', null)
|
||||
: query.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
||||
.where('users.d_tag', 'is', null);
|
||||
query = query
|
||||
.leftJoin(usersQuery, (join) => join.onRef('users.d_tag', '=', 'events.pubkey'))
|
||||
.where('users.d_tag', filter.local ? 'is not' : 'is', null);
|
||||
}
|
||||
|
||||
if (filter.relations?.includes('author')) {
|
||||
|
|
Loading…
Reference in New Issue