From 1c3495ef59a9bd1cfa61c27fc15873a4d8ecf99f Mon Sep 17 00:00:00 2001 From: PrivateGER Date: Mon, 7 Oct 2024 16:23:24 +0200 Subject: [PATCH] Make including followers in response a parameter --- .../backend/src/server/api/endpoints/federation/followers.ts | 3 ++- .../backend/src/server/api/endpoints/federation/following.ts | 3 ++- packages/frontend/src/pages/instance-info.vue | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/federation/followers.ts b/packages/backend/src/server/api/endpoints/federation/followers.ts index f114363eec..c7630bed93 100644 --- a/packages/backend/src/server/api/endpoints/federation/followers.ts +++ b/packages/backend/src/server/api/endpoints/federation/followers.ts @@ -33,6 +33,7 @@ export const paramDef = { sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, + includeFollower: { type: 'boolean', default: false }, }, required: ['host'], } as const; @@ -54,7 +55,7 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: true }); + return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: ps.includeFollower }); }); } } diff --git a/packages/backend/src/server/api/endpoints/federation/following.ts b/packages/backend/src/server/api/endpoints/federation/following.ts index 9f574f124e..516cf7b56a 100644 --- a/packages/backend/src/server/api/endpoints/federation/following.ts +++ b/packages/backend/src/server/api/endpoints/federation/following.ts @@ -33,6 +33,7 @@ export const paramDef = { sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, + includeFollower: { type: 'boolean', default: false }, }, required: ['host'], } as const; @@ -54,7 +55,7 @@ export default class extends Endpoint { // eslint- .limit(ps.limit) .getMany(); - return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: true }); + return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: ps.includeFollower }); }); } } diff --git a/packages/frontend/src/pages/instance-info.vue b/packages/frontend/src/pages/instance-info.vue index b8d9434498..19007401e5 100644 --- a/packages/frontend/src/pages/instance-info.vue +++ b/packages/frontend/src/pages/instance-info.vue @@ -220,6 +220,7 @@ const followingPagination = { limit: 10, params: { host: props.host, + includeFollower: true, }, offsetMode: false, }; @@ -229,6 +230,7 @@ const followersPagination = { limit: 10, params: { host: props.host, + includeFollower: true, }, offsetMode: false, };