From 16402d84820e784b69334e7ce5f41b515234dd4b Mon Sep 17 00:00:00 2001 From: George Politis Date: Fri, 15 Oct 2021 16:55:23 +0100 Subject: [PATCH] Include the callstats username in the rtcstats display name. (#10173) We want to be able to correlate between rtcstats and callstats, so we're appending the callstats user name (if it exists) to the display name. --- react/features/rtcstats/middleware.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/react/features/rtcstats/middleware.js b/react/features/rtcstats/middleware.js index 9c3aa96bc..07046f653 100644 --- a/react/features/rtcstats/middleware.js +++ b/react/features/rtcstats/middleware.js @@ -1,5 +1,7 @@ // @flow +import { jitsiLocalStorage } from '@jitsi/js-utils'; + import { getAmplitudeIdentity } from '../analytics'; import { CONFERENCE_UNIQUE_ID_SET, getConferenceOptions, getRoomName } from '../base/conference'; import { LIB_WILL_INIT } from '../base/lib-jitsi-meet'; @@ -72,12 +74,18 @@ MiddlewareRegistry.register(store => next => action => { // This is done in order to facilitate queries based on different conference configurations. // e.g. Find all RTCPeerConnections that connect to a specific shard or were created in a // conference with a specific version. + // XXX(george): we also want to be able to correlate between rtcstats and callstats, so we're + // appending the callstats user name (if it exists) to the display name. + const displayName = options.statisticsId + || options.statisticsDisplayName + || jitsiLocalStorage.getItem('callStatsUserName'); + RTCStats.sendIdentityData({ ...getAmplitudeIdentity(), ...options, endpointId: localParticipant?.id, confName: getRoomName(state), - displayName: localParticipant?.name, + displayName, meetingUniqueId }); } catch (error) {