feat: signal server tag
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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]
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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(
|
||||
() =>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -489,7 +489,8 @@ export class UsersEffects {
|
||||
|
||||
this.webrtc.identify(user.oderId || user.id, this.resolveDisplayName(user), undefined, {
|
||||
description: user.description,
|
||||
profileUpdatedAt: user.profileUpdatedAt
|
||||
profileUpdatedAt: user.profileUpdatedAt,
|
||||
homeSignalServerUrl: user.homeSignalServerUrl
|
||||
});
|
||||
})
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user