From 57e76fe69b1ad4626616a79e2f8d0053fd4ad829 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 18 Aug 2025 18:28:13 +0200 Subject: [PATCH] ov-components: Update participant name handling in Session and Toolbar components --- .../src/lib/components/session/session.component.ts | 8 +++++--- .../src/lib/components/toolbar/toolbar.component.ts | 3 ++- .../src/lib/models/participant.model.ts | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts index 88ac945e..dc0a9260 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/session/session.component.ts @@ -290,7 +290,8 @@ export class SessionComponent implements OnInit, OnDestroy { await this.openviduService.disconnectRoom(() => { this.onParticipantLeft.emit({ roomName: this.openviduService.getRoomName(), - participantName: this.participantService.getLocalParticipant()?.identity || '', + participantName: this.participantService.getLocalParticipant()?.name || '', + identity: this.participantService.getLocalParticipant()?.identity || '', reason }); }, false); @@ -447,7 +448,7 @@ export class SessionComponent implements OnInit, OnDestroy { this.log.d(`Data event received: ${topic}`); switch (topic) { case DataTopic.CHAT: - const participantName = participant?.identity || 'Unknown'; + const participantName = participant?.name || 'Unknown'; this.chatService.addRemoteMessage(event.message, participantName); break; case DataTopic.RECORDING_STARTING: @@ -537,7 +538,8 @@ export class SessionComponent implements OnInit, OnDestroy { this.actionService.closeConnectionDialog(); const participantLeftEvent: ParticipantLeftEvent = { roomName: this.openviduService.getRoomName(), - participantName: this.participantService.getLocalParticipant()?.identity || '', + participantName: this.participantService.getLocalParticipant()?.name || '', + identity: this.participantService.getLocalParticipant()?.identity || '', reason: ParticipantLeftReason.NETWORK_DISCONNECT }; const messageErrorKey = 'ERRORS.DISCONNECT'; diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/toolbar/toolbar.component.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/toolbar/toolbar.component.ts index 35a755ad..0b879cc1 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/toolbar/toolbar.component.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/components/toolbar/toolbar.component.ts @@ -558,7 +558,8 @@ export class ToolbarComponent implements OnInit, OnDestroy, AfterViewInit { await this.openviduService.disconnectRoom(() => { this.onParticipantLeft.emit({ roomName: this.openviduService.getRoomName(), - participantName: this.participantService.getLocalParticipant()?.identity || '', + participantName: this.participantService.getLocalParticipant()?.name || '', + identity: this.participantService.getLocalParticipant()?.identity || '', reason: ParticipantLeftReason.LEAVE }); this.onRoomDisconnected.emit(); diff --git a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts index 98441d85..61d3b20d 100644 --- a/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts +++ b/openvidu-components-angular/projects/openvidu-components-angular/src/lib/models/participant.model.ts @@ -18,6 +18,7 @@ import { export interface ParticipantLeftEvent { roomName: string; participantName: string; + identity: string; reason: ParticipantLeftReason; }