From a340b13f6589e03ff51970edc39d020744b0c848 Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Thu, 11 Jan 2024 10:01:27 -0500 Subject: [PATCH] Fix group call continuing to ring after accepted on another device. --- .../IncomingGroupCallActionProcessor.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java index 77bf7cfceb..e03fb1c10e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java +++ b/app/src/main/java/org/thoughtcrime/securesms/service/webrtc/IncomingGroupCallActionProcessor.java @@ -52,18 +52,18 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro @NonNull ACI sender, @NonNull CallManager.RingUpdate ringUpdate) { - Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + Long.toHexString(ringId) + " update: " + ringUpdate); + Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate); Recipient recipient = remotePeerGroup.getRecipient(); boolean updateForCurrentRingId = ringId == currentState.getCallSetupState(RemotePeer.GROUP_CALL_ID).getRingId(); boolean isCurrentlyRinging = currentState.getCallInfoState().getGroupCallState().isRinging(); - if (SignalDatabase.calls().isRingCancelled(ringId, remotePeerGroup.getId())) { + if (SignalDatabase.calls().isRingCancelled(ringId, remotePeerGroup.getId()) && !updateForCurrentRingId) { try { - Log.i(TAG, "Ignoring incoming ring request for already cancelled ring: " + Long.toHexString(ringId)); + Log.i(TAG, "Ignoring incoming ring request for already cancelled ring: " + ringId); webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, null); } catch (CallException e) { - Log.w(TAG, "Error while trying to cancel ring: " + Long.toHexString(ringId), e); + Log.w(TAG, "Error while trying to cancel ring: " + ringId, e); } return currentState; } @@ -76,7 +76,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro ringUpdate); if (updateForCurrentRingId && isCurrentlyRinging) { - Log.i(TAG, "Cancelling current ring: " + Long.toHexString(ringId)); + Log.i(TAG, "Cancelling current ring: " + ringId); currentState = currentState.builder() .changeCallInfoState() @@ -93,20 +93,20 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro if (!updateForCurrentRingId && isCurrentlyRinging) { try { - Log.i(TAG, "Already ringing so reply busy for new ring: " + Long.toHexString(ringId)); + Log.i(TAG, "Already ringing so reply busy for new ring: " + ringId); webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, CallManager.RingCancelReason.Busy); } catch (CallException e) { - Log.w(TAG, "Error while trying to cancel ring: " + Long.toHexString(ringId), e); + Log.w(TAG, "Error while trying to cancel ring: " + ringId, e); } return currentState; } if (updateForCurrentRingId) { - Log.i(TAG, "Already ringing for ring: " + Long.toHexString(ringId)); + Log.i(TAG, "Already ringing for ring: " + ringId); return currentState; } - Log.i(TAG, "Requesting new ring: " + Long.toHexString(ringId)); + Log.i(TAG, "Requesting new ring: " + ringId); Recipient ringerRecipient = Recipient.externalPush(sender); SignalDatabase.calls().insertOrUpdateGroupCallFromRingState(