mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
merge: Fix logic error in generateBlockedHostQueryForNote (!1085)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1085 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
commit
cea594053f
1 changed files with 7 additions and 4 deletions
|
@ -261,11 +261,14 @@ export class QueryService {
|
|||
q.leftJoin(`note.${key}Instance`, `${key}Instance`);
|
||||
q.andWhere(new Brackets(qb => {
|
||||
qb.orWhere(`note.${key}Id IS NULL`) // no corresponding user
|
||||
.orWhere(`note.${key}Host IS NULL`) // local
|
||||
.orWhere(`${key}Instance.isBlocked = false`); // not blocked
|
||||
.orWhere(`note.${key}Host IS NULL`); // local
|
||||
|
||||
if (!allowSilenced) {
|
||||
qb.orWhere(`${key}Instance.isSilenced = false`); // not silenced
|
||||
if (allowSilenced) {
|
||||
qb.orWhere(`${key}Instance.isBlocked = false`); // not blocked
|
||||
} else {
|
||||
qb.orWhere(new Brackets(qbb => qbb
|
||||
.andWhere(`${key}Instance.isBlocked = false`) // not blocked
|
||||
.andWhere(`${key}Instance.isSilenced = false`))); // not silenced
|
||||
}
|
||||
|
||||
if (excludeAuthor) {
|
||||
|
|
Loading…
Add table
Reference in a new issue