rn,conference: log pin participant analytics events also on mobile

This commit is contained in:
Saúl Ibarra Corretgé 2019-07-30 15:26:30 +02:00 committed by Saúl Ibarra Corretgé
parent 5261f61110
commit 4d5332cadf
1 changed files with 19 additions and 22 deletions

View File

@ -435,31 +435,28 @@ function _pinParticipant({ getState }, next, action) {
const participants = state['features/base/participants'];
const id = action.participant.id;
const participantById = getParticipantById(participants, id);
const pinnedParticipant = getPinnedParticipant(participants);
const actionName = id ? ACTION_PINNED : ACTION_UNPINNED;
const local
= (participantById && participantById.local)
|| (!id && pinnedParticipant && pinnedParticipant.local);
let participantIdForEvent;
if (typeof APP !== 'undefined') {
const pinnedParticipant = getPinnedParticipant(participants);
const actionName = id ? ACTION_PINNED : ACTION_UNPINNED;
const local
= (participantById && participantById.local)
|| (!id && pinnedParticipant && pinnedParticipant.local);
let participantIdForEvent;
if (local) {
participantIdForEvent = local;
} else {
participantIdForEvent = actionName === ACTION_PINNED
? id : pinnedParticipant && pinnedParticipant.id;
}
sendAnalytics(createPinnedEvent(
actionName,
participantIdForEvent,
{
local,
'participant_count': conference.getParticipantCount()
}));
if (local) {
participantIdForEvent = local;
} else {
participantIdForEvent
= actionName === ACTION_PINNED ? id : pinnedParticipant && pinnedParticipant.id;
}
sendAnalytics(createPinnedEvent(
actionName,
participantIdForEvent,
{
local,
'participant_count': conference.getParticipantCount()
}));
return next(action);
}