summaryrefslogtreecommitdiff
path: root/packages/backend/src/server
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-03 15:14:22 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-03 15:14:22 -0400
commit2258e439af06dca8093e89c5667c28bf5bc6be74 (patch)
tree1f06e39aef7e24f9c85eca02eb75842359c8d3a9 /packages/backend/src/server
parentmore QueryService fixes (diff)
downloadsharkey-2258e439af06dca8093e89c5667c28bf5bc6be74.tar.gz
sharkey-2258e439af06dca8093e89c5667c28bf5bc6be74.tar.bz2
sharkey-2258e439af06dca8093e89c5667c28bf5bc6be74.zip
replace silenced users check with generateSilencedUserQueryForNotes in bubble-timeline.ts
Diffstat (limited to 'packages/backend/src/server')
-rw-r--r--packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts20
1 files changed, 2 insertions, 18 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 bbd41ca99f..214beface5 100644
--- a/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts
+++ b/packages/backend/src/server/api/endpoints/notes/bubble-timeline.ts
@@ -68,7 +68,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private queryService: QueryService,
private roleService: RoleService,
private activeUsersChart: ActiveUsersChart,
- private cacheService: CacheService,
) {
super(meta, paramDef, async (ps, me) => {
const policies = await this.roleService.getUserPolicies(me ? me.id : null);
@@ -76,10 +75,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new ApiError(meta.errors.btlDisabled);
}
- // Run this asynchronously - we will await it after the query completes.
- // Catch-suppression is needed to avoid "unhandled rejection" if the query throws.
- const followingsPromise = me ? this.cacheService.userFollowingsCache.fetch(me.id).catch(() => null) : null;
-
//#region Construct query
const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
@@ -92,6 +87,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.leftJoinAndSelect('renote.user', 'renoteUser');
this.queryService.generateBlockedHostQueryForNote(query);
+ this.queryService.generateSilencedUserQueryForNotes(query, me);
if (me) {
this.queryService.generateMutedUserQueryForNotes(query, me);
this.queryService.generateBlockedUserQueryForNotes(query, me);
@@ -122,19 +118,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
//#endregion
- let timeline = await query.limit(ps.limit).getMany();
-
- const followings = await followingsPromise;
- if (me && followings) {
- timeline = timeline.filter(note => {
- // Allow my own notes
- if (note.userId === me.id) return true;
- // Allow if not silenced
- if (!note.user?.isSilenced) return true;
- // Allow if following
- return followings[note.userId];
- });
- }
+ const timeline = await query.limit(ps.limit).getMany();
if (me) {
process.nextTick(() => {