summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/notes.ts
diff options
context:
space:
mode:
authorJulia <julia@insertdomain.name>2025-06-19 21:35:18 +0000
committerJulia <julia@insertdomain.name>2025-06-19 21:35:18 +0000
commita77c32b17da63d3932b219f74152cce023a30f4a (patch)
treed2a05796e942c8f250bbd01369eab0cbe5a14531 /packages/backend/src/server/api/endpoints/notes.ts
parentmerge: release 2025.4.2 (!1051) (diff)
parentMerge branch 'develop' into release/2025.4.3 (diff)
downloadsharkey-a77c32b17da63d3932b219f74152cce023a30f4a.tar.gz
sharkey-a77c32b17da63d3932b219f74152cce023a30f4a.tar.bz2
sharkey-a77c32b17da63d3932b219f74152cce023a30f4a.zip
merge: prepare release 2025.4.3 (!1125)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1125 Approved-by: Marie <github@yuugi.dev> Approved-by: Julia <julia@insertdomain.name>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/notes.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/notes.ts23
1 files changed, 20 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/notes.ts b/packages/backend/src/server/api/endpoints/notes.ts
index f6c37023e1..00a88521fd 100644
--- a/packages/backend/src/server/api/endpoints/notes.ts
+++ b/packages/backend/src/server/api/endpoints/notes.ts
@@ -64,7 +64,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.leftJoinAndSelect('note.reply', 'reply')
.leftJoinAndSelect('note.renote', 'renote')
.leftJoinAndSelect('reply.user', 'replyUser')
- .leftJoinAndSelect('renote.user', 'renoteUser');
+ .leftJoinAndSelect('renote.user', 'renoteUser')
+ .limit(ps.limit);
+
+ this.queryService.generateVisibilityQuery(query, me);
+ this.queryService.generateBlockedHostQueryForNote(query);
+ if (me) {
+ this.queryService.generateSilencedUserQueryForNotes(query, me);
+ this.queryService.generateMutedUserQueryForNotes(query, me);
+ this.queryService.generateBlockedUserQueryForNotes(query, me);
+ }
if (ps.local) {
query.andWhere('note.userHost IS NULL');
@@ -75,7 +84,15 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
if (ps.renote !== undefined) {
- query.andWhere(ps.renote ? 'note.renoteId IS NOT NULL' : 'note.renoteId IS NULL');
+ if (ps.renote) {
+ this.queryService.andIsRenote(query, 'note');
+
+ if (me) {
+ this.queryService.generateMutedUserRenotesQueryForNotes(query, me);
+ }
+ } else {
+ this.queryService.andIsNotRenote(query, 'note');
+ }
}
if (ps.withFiles !== undefined) {
@@ -91,7 +108,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// query.isBot = bot;
//}
- const notes = await query.limit(ps.limit).getMany();
+ const notes = await query.getMany();
return await this.noteEntityService.packMany(notes);
});