summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/notes
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-01 19:35:25 +0000
committerHazelnoot <acomputerdog@gmail.com>2025-06-01 19:35:25 +0000
commitf06ca9f7ee48d20dada2db8a20ad4a97c85acd6b (patch)
tree1df9b3af34a8272bbae088ee57555b5805b547f0 /packages/backend/src/server/api/endpoints/notes
parentmerge: Fix logic error in generateBlockedHostQueryForNote (!1085) (diff)
parentsync up logic between notes/bubble-timeline.ts and channels/bubble-timeline.ts (diff)
downloadsharkey-f06ca9f7ee48d20dada2db8a20ad4a97c85acd6b.tar.gz
sharkey-f06ca9f7ee48d20dada2db8a20ad4a97c85acd6b.tar.bz2
sharkey-f06ca9f7ee48d20dada2db8a20ad4a97c85acd6b.zip
merge: Fix bubble timeline logic (!1088)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1088 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes')
-rw-r--r--packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts
index 2677143a49..17c9b31c90 100644
--- a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts
+++ b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts
@@ -81,7 +81,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('note.visibility = \'public\'')
.andWhere('note.channelId IS NULL')
- .andWhere('note.userHost IS NULL')
+ .andWhere('note.userHost IS NOT NULL')
.andWhere('userInstance.isBubbled = true') // This comes from generateBlockedHostQueryForNote below
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('note.reply', 'reply')
@@ -94,6 +94,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (me) this.queryService.generateMutedUserQueryForNotes(query, me);
if (me) this.queryService.generateBlockedUserQueryForNotes(query, me);
if (me) this.queryService.generateMutedUserRenotesQueryForNotes(query, me);
+ if (!me) query.andWhere('user.requireSigninToViewContents = false');
if (ps.withFiles) {
query.andWhere('note.fileIds != \'{}\'');
@@ -115,7 +116,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
let timeline = await query.limit(ps.limit).getMany();
timeline = timeline.filter(note => {
- if (note.user?.isSilenced && me && followings && note.userId !== me.id && !followings[note.userId]) return false;
+ if (note.user?.isSilenced) {
+ if (!me) return false;
+ if (!followings) return false;
+ if (note.userId !== me.id) {
+ return followings[note.userId];
+ }
+ }
return true;
});