mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 03:17:38 -07:00
[backend] Make inverse postgres FTS filters consistent with regular ones
This commit is contained in:
parent
98f40d8865
commit
8c43c5cae6
1 changed files with 7 additions and 3 deletions
|
@ -143,9 +143,13 @@ function instanceFilter(query: SelectQueryBuilder<any>, filter: string, id: numb
|
|||
}
|
||||
|
||||
function instanceFilterInverse(query: SelectQueryBuilder<any>, filter: string, id: number) {
|
||||
if (filter === 'local') {
|
||||
query.andWhere(`note.userHost IS NOT NULL`);
|
||||
} else {
|
||||
query.andWhere(`note.userHost <> :instance_${id}`);
|
||||
query.setParameter(`instance_${id}`, filter);
|
||||
}
|
||||
}
|
||||
|
||||
function miscFilter(query: SelectQueryBuilder<any>, filter: string) {
|
||||
let subQuery: SelectQueryBuilder<any> | null = null;
|
||||
|
@ -176,7 +180,7 @@ function miscFilterInverse(query: SelectQueryBuilder<any>, filter: string) {
|
|||
subQuery = Followings.createQueryBuilder('following')
|
||||
.select('following.followeeId')
|
||||
.where('following.followerId = :meId')
|
||||
} else if (filter === 'replies') {
|
||||
} else if (filter === 'replies' || filter === 'reply') {
|
||||
query.andWhere('note.replyId IS NULL');
|
||||
} else if (filter === 'boosts' || filter === 'boost' || filter === 'renotes' || filter === 'renote') {
|
||||
query.andWhere('note.renoteId IS NULL');
|
||||
|
|
Loading…
Reference in a new issue