From 54bce681f97c3e507a513c205021f0904355d2c0 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:33:43 +0200 Subject: [PATCH] feat(server): add isFederated flag and visibleChannelIdSet to ready payload builder --- packages/server/src/ws/handler.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/ws/handler.ts b/packages/server/src/ws/handler.ts index f31be1af..e14e03ed 100644 --- a/packages/server/src/ws/handler.ts +++ b/packages/server/src/ws/handler.ts @@ -906,6 +906,7 @@ function buildReadyPayload(userId: string): { throw new Error('User not found'); } const user = sanitizeUser(userRow, true); + const isFederated = !!userRow.homeInstance; // Cache showActivity and status for Rich Presence connectionManager.setUserShowActivity(userId, userRow.showActivity !== 0); @@ -919,6 +920,7 @@ function buildReadyPayload(userId: string): { const spaceIds = memberships.map(m => m.spaceId); + const visibleChannelIdSet = new Set(); const spaces: SpaceWithChannelsAndMembers[] = []; if (spaceIds.length > 0) { @@ -1057,6 +1059,7 @@ function buildReadyPayload(userId: string): { const chPerms = computePermissions(userId, spaceRow.id, ch.id); const hasView = (chPerms & PermissionBits.VIEW_CHANNEL) !== 0n || (chPerms & PermissionBits.ADMINISTRATOR) !== 0n; if (hasView) { + visibleChannelIdSet.add(ch.id); visibleChannels.push({ id: ch.id, spaceId: ch.spaceId,