feat: signal server tag

This commit is contained in:
2026-06-05 06:16:02 +02:00
parent 6865147e8f
commit bf4e6891d1
69 changed files with 2808 additions and 1269 deletions

View File

@@ -375,7 +375,8 @@ export class RoomSignalingConnection {
this.webrtc.setCurrentServer(room.id);
this.webrtc.identify(oderId, displayName, wsUrl, {
description,
profileUpdatedAt
profileUpdatedAt,
homeSignalServerUrl: user?.homeSignalServerUrl
});
for (const backgroundRoom of backgroundRooms) {

View File

@@ -126,6 +126,7 @@ export class RoomStateSyncEffects {
...buildKnownUserExtras(room, user.oderId),
description: user.description,
profileUpdatedAt: user.profileUpdatedAt,
homeSignalServerUrl: user.homeSignalServerUrl,
presenceServerIds: [signalingMessage.serverId],
...(user.status ? { status: user.status } : {})
})
@@ -157,6 +158,7 @@ export class RoomStateSyncEffects {
displayName: signalingMessage.displayName,
description: signalingMessage.description,
profileUpdatedAt: signalingMessage.profileUpdatedAt,
homeSignalServerUrl: signalingMessage.homeSignalServerUrl,
status: signalingMessage.status
};
const actions: Action[] = [
@@ -165,6 +167,7 @@ export class RoomStateSyncEffects {
...buildKnownUserExtras(room, joinedUser.oderId),
description: joinedUser.description,
profileUpdatedAt: joinedUser.profileUpdatedAt,
homeSignalServerUrl: joinedUser.homeSignalServerUrl,
presenceServerIds: [signalingMessage.serverId]
})
})

View File

@@ -149,6 +149,26 @@ export class RoomsEffects {
)
);
/** Re-joins saved rooms after the signaling socket reconnects so presence is restored. */
resyncRoomsOnSignalingReconnect$ = createEffect(
() =>
this.webrtc.signalingReconnected$.pipe(
withLatestFrom(
this.store.select(selectCurrentUser),
this.store.select(selectCurrentRoom),
this.store.select(selectSavedRooms)
),
tap(([
, user,
currentRoom,
savedRooms
]) => {
this.signalingConnection.syncSavedRoomConnections(user ?? null, currentRoom, savedRooms, this.router.url);
})
),
{ dispatch: false }
);
/** Reconnects saved rooms so joined servers stay online while the app is running. */
keepSavedRoomsConnected$ = createEffect(
() =>

View File

@@ -208,7 +208,14 @@ export interface RoomPresenceSignalingMessage {
reason?: string;
serverId?: string;
serverIds?: string[];
users?: { oderId: string; displayName: string; description?: string; profileUpdatedAt?: number; status?: string }[];
users?: {
oderId: string;
displayName: string;
description?: string;
profileUpdatedAt?: number;
homeSignalServerUrl?: string;
status?: string;
}[];
oderId?: string;
displayName?: string;
description?: string;
@@ -216,5 +223,6 @@ export interface RoomPresenceSignalingMessage {
icon?: string;
iconUpdatedAt?: number;
profileUpdatedAt?: number;
homeSignalServerUrl?: string;
status?: string;
}