private void ToxAv_OnCallRequestReceived(object sender, ToxAvEventArgs.CallRequestEventArgs e) { if (_callInfo != null) { //TODO: notify the user there's yet another call incoming _toxAv.SendControl(e.FriendNumber, ToxAvCallControl.Cancel); return; } MainWindow.Instance.UInvoke(() => { var friend = MainWindow.Instance.ViewModel.CurrentFriendListView.FindFriend(e.FriendNumber); if (friend == null) { Debugging.Write("Received a call request from a friend we don't know about!"); return; } friend.CallState = CallState.Calling; if (e.VideoEnabled) { friend.CallState |= CallState.SendingVideo; } }); }
private void CallRequestReceivedHandler(object sender, ToxAvEventArgs.CallRequestEventArgs e) { // Automatically decline call request if we have an ongoing call. // TODO: Instead of this, tell the user about the situation and let him/her decide if he/she want to hang up the current call and answer the new one! if (_friendInCall != -1) { _toxAv.SendControl(e.FriendNumber, ToxAvCallControl.Cancel); return; } _friendInCall = e.FriendNumber; CallRequestReceived?.Invoke(this, e); }
private void OnToxAvCallRequestReceived(object sender, ToxAvEventArgs.CallRequestEventArgs e) { Logger.Log(LogLevel.Verbose, "state: " + e.State); if (this.callInfo != null) { // TODO: notify the user there's yet another call incoming this.toxAv.SendControl(e.FriendNumber, ToxAvCallControl.Cancel); return; } try { MainForm.Instance.NotifyToxAvCallRequestReceived(e); } catch (Exception ex) { Logger.Log(LogLevel.Error, ex.Message); } }
private void CallRequestReceivedHandler(object sender, ToxAvEventArgs.CallRequestEventArgs e) { DispatcherHelper.CheckBeginInvokeOnUI(() => { State = CallState.IncomingCall; }); }