summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/server/api')
-rw-r--r--packages/backend/src/server/api/endpoints/federation/instances.ts2
-rw-r--r--packages/backend/src/server/api/endpoints/federation/stats.ts4
-rw-r--r--packages/backend/src/server/api/stream/Connection.ts12
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,