From 2ebd907c473c47938a9a40b046f9b098680f0f4b Mon Sep 17 00:00:00 2001 From: ari melody Date: Mon, 1 Jul 2024 05:59:55 +0100 Subject: [PATCH] [backend/masto-client] Add follow_requests_count to verify_credentials response --- packages/backend/src/server/api/mastodon/helpers/user.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/server/api/mastodon/helpers/user.ts b/packages/backend/src/server/api/mastodon/helpers/user.ts index 77dd6cce8..4cc52714a 100644 --- a/packages/backend/src/server/api/mastodon/helpers/user.ts +++ b/packages/backend/src/server/api/mastodon/helpers/user.ts @@ -215,6 +215,7 @@ export class UserHelpers { const user = ctx.user as ILocalUser; const acct = UserConverter.encode(user, ctx); const profile = UserProfiles.findOneByOrFail({ userId: user.id }); + const followRequests = FollowRequests.count({ where: { followeeId: user.id } }); const privacy = this.getDefaultNoteVisibility(ctx); const fields = profile.then(profile => profile.fields.map(field => { return { @@ -229,6 +230,7 @@ export class UserHelpers { privacy: privacy.then(p => VisibilityConverter.encode(p)), sensitive: profile.then(p => p.alwaysMarkNsfw), language: profile.then(p => p.lang ?? ''), + follow_requests_count: followRequests, }; const result = {