Skip to content

Commit

Permalink
Fix issue where raise hand would rename user
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonini committed Nov 11, 2020
1 parent d19a485 commit 1896f5a
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions joinmeeting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 29,7 @@ public partial class joinmeeting : Window
uint userid;
string userName;
int count = 0;

ParticipantSettings settings;

RaiseLowerHand raisescreen;
Expand Down Expand Up @@ -122,18 123,18 @@ public void onMeetingStatusChanged(MeetingStatus status, int iResult)
}


public int ExtractNumber(string original)
public Tuple<bool,int> ExtractNumber(string original)
{
if (original.Any(c => char.IsDigit(c)))
{
var result = int.Parse(new string(original.Where(c => char.IsDigit(c)).ToArray()));

if (result > 10)
{
return 1;
return new Tuple<bool, int>(false,1);
}

return result;
return new Tuple<bool, int>(false, result);
}

int returnValue = 1;
Expand All @@ -151,7 152,7 @@ public int ExtractNumber(string original)
returnValue = original.Split(settings.SplitNamesOn.ToArray()).Length-1;
}

return returnValue;
return new Tuple<bool, int>(true, returnValue);
}

public void UpdateCount()
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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)
{
Expand All @@ -225,6 236,7 @@ public void onUserNameChanged(uint userId, string userName)
}
}
}

private void RegisterCallBack()
{
CZoomSDKeDotNetWrap.Instance.GetMeetingServiceWrap().Add_CB_onMeetingStatusChanged(onMeetingStatusChanged);
Expand Down

0 comments on commit 1896f5a

Please sign in to comment.