diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-08-06 10:35:14 +0100 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-08-06 10:35:14 +0100 |
| commit | 34c1e9ea2b6389e4bcc86864bcfc34f449e4f677 (patch) | |
| tree | 3f67f257580a84e305ad5c1eb02e36ae5e2f0dc6 /packages/backend/src/server/api | |
| parent | revert AiScript hack for plugins (diff) | |
| parent | merge: don't send real-time updates of replies to blocked users #457 #573 (!566) (diff) | |
| download | sharkey-34c1e9ea2b6389e4bcc86864bcfc34f449e4f677.tar.gz sharkey-34c1e9ea2b6389e4bcc86864bcfc34f449e4f677.tar.bz2 sharkey-34c1e9ea2b6389e4bcc86864bcfc34f449e4f677.zip | |
Merge branch 'develop' into feature/misskey-2024.07
fixing conflicts in `package.json`
Diffstat (limited to 'packages/backend/src/server/api')
3 files changed, 15 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index c3f2247b69..c1ce3f2238 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -203,7 +203,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- const instances = await query.limit(ps.limit).offset(ps.offset).getMany(); - return await this.instanceEntityService.packMany(instances); + return await this.instanceEntityService.packMany(instances, me); }); } } diff --git a/packages/backend/src/server/api/endpoints/federation/stats.ts b/packages/backend/src/server/api/endpoints/federation/stats.ts index bac54970ab..69900bff9a 100644 --- a/packages/backend/src/server/api/endpoints/federation/stats.ts +++ b/packages/backend/src/server/api/endpoints/federation/stats.ts @@ -107,9 +107,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- const gotPubCount = topPubInstances.map(x => x.followingCount).reduce((a, b) => a + b, 0); return await awaitAll({ - topSubInstances: this.instanceEntityService.packMany(topSubInstances), + topSubInstances: this.instanceEntityService.packMany(topSubInstances, me), otherFollowersCount: Math.max(0, allSubCount - gotSubCount), - topPubInstances: this.instanceEntityService.packMany(topPubInstances), + topPubInstances: this.instanceEntityService.packMany(topPubInstances, me), otherFollowingCount: Math.max(0, allPubCount - gotPubCount), }); }); diff --git a/packages/backend/src/server/api/stream/Connection.ts b/packages/backend/src/server/api/stream/Connection.ts index 96082827f8..c24459c1e1 100644 --- a/packages/backend/src/server/api/stream/Connection.ts +++ b/packages/backend/src/server/api/stream/Connection.ts @@ -205,6 +205,18 @@ export default class Connection { @bindThis private async onNoteStreamMessage(data: GlobalEvents['note']['payload']) { + // we must not send to the frontend information about notes from + // users who blocked the logged-in user, even when they're replies + // to notes the logged-in user can see + if (data.type === 'replied') { + const noteUserId = data.body.body.userId; + if (noteUserId !== null) { + if (this.userIdsWhoBlockingMe.has(noteUserId)) { + return; + } + } + } + this.sendMessageToWs('noteUpdated', { id: data.body.id, type: data.type, |