From 1896f5a1cc587789f2cb5e88fb10d49aa643cbc7 Mon Sep 17 00:00:00 2001 From: Roberto Bonini Date: Wed, 11 Nov 2020 17:16:31 +0000 Subject: [PATCH] Fix issue where raise hand would rename user --- joinmeeting.xaml.cs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/joinmeeting.xaml.cs b/joinmeeting.xaml.cs index 5cfea0a..6e0dc2e 100644 --- a/joinmeeting.xaml.cs +++ b/joinmeeting.xaml.cs @@ -29,6 +29,7 @@ public partial class joinmeeting : Window uint userid; string userName; int count = 0; + ParticipantSettings settings; RaiseLowerHand raisescreen; @@ -122,7 +123,7 @@ public void onMeetingStatusChanged(MeetingStatus status, int iResult) } - public int ExtractNumber(string original) + public Tuple ExtractNumber(string original) { if (original.Any(c => char.IsDigit(c))) { @@ -130,10 +131,10 @@ public int ExtractNumber(string original) if (result > 10) { - return 1; + return new Tuple(false,1); } - return result; + return new Tuple(false, result); } int returnValue = 1; @@ -151,7 +152,7 @@ public int ExtractNumber(string original) returnValue += original.Split(settings.SplitNamesOn.ToArray()).Length-1; } - return returnValue; + return new Tuple(true, returnValue); } public void UpdateCount() @@ -171,7 +172,12 @@ public void UpdateCount() Console.WriteLine($"{name}: ({participants})"); - count += participants; + //if ( participants.Item1 && CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().GetUserByUserID(this.userid).IsHost()) + //{ + // ZOOM_SDK_DOTNET_WRAP.CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().ChangeUserName(userid, $"{name} x {count}", false); + //} + + count += participants.Item2; } } @@ -208,10 +214,15 @@ public void onHostChangeNotification(uint userId) } public void onLowOrRaiseHandStatusChanged(bool bLow, uint userid) { - if (bLow) + if (bLow && userid == this.userid) { CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().ChangeUserName(userid, userName, false); } + + //if (CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingParticipantsController().GetUserByUserID(this.userid).IsHost()) + //{ + // CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().GetMeetingAudioController().MuteAudio(userid, false); + //} } public void onUserNameChanged(uint userId, string userName) { @@ -225,6 +236,7 @@ public void onUserNameChanged(uint userId, string userName) } } } + private void RegisterCallBack() { CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Add_CB_onMeetingStatusChanged(onMeetingStatusChanged);