From 775d8f6e3afb6f243fd4f3a4b40b58ed086b7689 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 16 Oct 2023 23:45:03 +0200 Subject: [PATCH] [mastodon-client] Return fqn field for accounts --- packages/backend/src/server/api/mastodon/converters/user.ts | 2 ++ packages/backend/src/server/api/mastodon/entities/account.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/backend/src/server/api/mastodon/converters/user.ts b/packages/backend/src/server/api/mastodon/converters/user.ts index 71622cbf5..07a3c3235 100644 --- a/packages/backend/src/server/api/mastodon/converters/user.ts +++ b/packages/backend/src/server/api/mastodon/converters/user.ts @@ -25,6 +25,7 @@ export class UserConverter { const cacheHit = cache.accounts.find(p => p.id == u.id); if (cacheHit) return cacheHit; + let fqn = `${u.username}@${u.host ?? config.domain}`; let acct = u.username; let acctUrl = `https://${u.host || config.host}/@${u.username}`; if (u.host) { @@ -79,6 +80,7 @@ export class UserConverter { id: u.id, username: u.username, acct: acct, + fqn: fqn, display_name: u.name || u.username, locked: u.isLocked, created_at: u.createdAt.toISOString(), diff --git a/packages/backend/src/server/api/mastodon/entities/account.ts b/packages/backend/src/server/api/mastodon/entities/account.ts index 5c1100190..68ebb4a66 100644 --- a/packages/backend/src/server/api/mastodon/entities/account.ts +++ b/packages/backend/src/server/api/mastodon/entities/account.ts @@ -6,6 +6,7 @@ namespace MastodonEntity { id: string; username: string; acct: string; + fqn: string; display_name: string; locked: boolean; created_at: string;