fix logic error in generateBlockedHostQueryForNote that would allow blocked instances if allowSilenced was set to false

This commit is contained in:
Hazelnoot 2025-06-01 14:34:58 -04:00
parent 15c45633e5
commit ac8fad2422

View file

@ -263,8 +263,12 @@ export class QueryService {
.orWhere(`note.${key}Host IS NULL`) // local
.orWhere(`${key}Instance.isBlocked = false`); // not blocked
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) {