feat(federation): export resolveLocalUser and resolveOrCreateReplicatedUser

Make both identity resolution helpers module-level exports so the group DM
endpoint can import and use them when resolving federated user identities
during group DM creation.
This commit is contained in:
Jannis Braun
2026-03-26 23:13:17 +01:00
parent 255ab657eb
commit 4b181b925d
+2 -2
View File
@@ -831,7 +831,7 @@ export async function federationRoutes(app: FastifyInstance): Promise<void> {
* Matches users where home_user_id = homeUserId, or where * Matches users where home_user_id = homeUserId, or where
* the user's own id equals homeUserId and they have no home_instance set (local user). * the user's own id equals homeUserId and they have no home_instance set (local user).
*/ */
function resolveLocalUser( export function resolveLocalUser(
homeUserId: string, homeUserId: string,
db: ReturnType<typeof getDb>, db: ReturnType<typeof getDb>,
): typeof schema.users.$inferSelect | undefined { ): typeof schema.users.$inferSelect | undefined {
@@ -865,7 +865,7 @@ function resolveLocalUser(
* friend-connect flow. We create a bare-bones row so the local DB * friend-connect flow. We create a bare-bones row so the local DB
* can reference them in dm_members / dm_messages. * can reference them in dm_members / dm_messages.
*/ */
function resolveOrCreateReplicatedUser( export function resolveOrCreateReplicatedUser(
homeUserId: string, homeUserId: string,
homeInstance: string, homeInstance: string,
db: ReturnType<typeof getDb>, db: ReturnType<typeof getDb>,