fix: resolve duplicate voice user in federated channel sidebar
Use origin-aware user ID resolution for optimistic voice add/remove instead of always using the home instance ID. Adds getMyUserIdForOrigin resolver (same pattern as getApiForOrigin) so joinVoiceChannel and leaveVoice use the correct federated user ID. Also fixes WS reconnect voice re-registration, invite URL for remote servers, and chatStore early-load guard for unmapped channels.
This commit is contained in:
@@ -172,7 +172,7 @@ function handleEvent(origin: string, event: ServerEvent): void {
|
||||
if (currentVoiceChannelId && isLiveKitConnected) {
|
||||
const voiceOrigin = getChannelOrigin(currentVoiceChannelId);
|
||||
if (voiceOrigin === origin) {
|
||||
const myId = isHome ? event.user.id : useAuthStore.getState().user?.id;
|
||||
const myId = event.user.id;
|
||||
if (myId) addVoiceUser(currentVoiceChannelId, myId);
|
||||
wsSend({ type: 'voice_join', channelId: currentVoiceChannelId }, origin);
|
||||
wsSend({ type: 'voice_status', isMuted, isDeafened, isCameraOn, isScreenSharing }, origin);
|
||||
|
||||
Reference in New Issue
Block a user