Adds condition to not check for already pinned participant if incoming message has user id < 0

This commit is contained in:
Neil Dorin
2021-06-09 17:38:50 -06:00
parent 0c56da112c
commit b71523bd2d

View File

@@ -1348,6 +1348,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId, status.ScreenIndex); Debug.Console(1, this, "Pin Status notification for UserId: {0}, ScreenIndex: {1}", status.PinnedUserId, status.ScreenIndex);
// Check for a participant already pinned to the same screen index. // Check for a participant already pinned to the same screen index.
if (status.PinnedUserId > 0)
{
var alreadyPinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex)); var alreadyPinnedParticipant = Participants.CurrentParticipants.FirstOrDefault(p => p.ScreenIndexIsPinnedToFb.Equals(status.ScreenIndex));
// Make sure that the already pinned participant isn't the same ID as for this message. If true, clear the pinned fb. // Make sure that the already pinned participant isn't the same ID as for this message. If true, clear the pinned fb.
@@ -1357,6 +1359,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId, alreadyPinnedParticipant.ScreenIndexIsPinnedToFb); alreadyPinnedParticipant.Name, alreadyPinnedParticipant.UserId, alreadyPinnedParticipant.ScreenIndexIsPinnedToFb);
alreadyPinnedParticipant.IsPinnedFb = false; alreadyPinnedParticipant.IsPinnedFb = false;
alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1; alreadyPinnedParticipant.ScreenIndexIsPinnedToFb = -1;
}
} }
var participant = Participants.CurrentParticipants.FirstOrDefault(p => p.UserId.Equals(status.PinnedUserId)); var participant = Participants.CurrentParticipants.FirstOrDefault(p => p.UserId.Equals(status.PinnedUserId));