summaryrefslogtreecommitdiff
path: root/packages/backend/src
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-01 19:35:20 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-06-01 19:35:20 +0000
commitcea594053fc3e71efcf684714a1bfaff178ca4a5 (patch)
treeed9f3fbeb253fc372c313bc23bd7a01951d30bff /packages/backend/src
parentmerge: Fix logic error in bubble timeline when withRenotes is false (!1086) (diff)
parentremove duplicate isBlocked check from generateBlockedHostQueryForNote (diff)
downloadsharkey-cea594053fc3e71efcf684714a1bfaff178ca4a5.tar.gz
sharkey-cea594053fc3e71efcf684714a1bfaff178ca4a5.tar.bz2
sharkey-cea594053fc3e71efcf684714a1bfaff178ca4a5.zip
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>
Diffstat (limited to 'packages/backend/src')
-rw-r--r--packages/backend/src/core/QueryService.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts
index 51d3f1e2ea..cf2419a9eb 100644
--- a/packages/backend/src/core/QueryService.ts
+++ b/packages/backend/src/core/QueryService.ts
@@ -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) {