Add stricter call row identification.

This commit is contained in:
Alex Hart
2023-04-06 16:21:40 -03:00
committed by Greyson Parrelli
parent 490feb358c
commit 433e8266c9
10 changed files with 204 additions and 65 deletions

View File

@@ -7,6 +7,7 @@ import org.signal.ringrtc.CallException;
import org.signal.ringrtc.CallManager;
import org.signal.ringrtc.PeekInfo;
import org.thoughtcrime.securesms.components.webrtc.EglBaseWrapper;
import org.thoughtcrime.securesms.database.CallTable;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.events.WebRtcViewModel;
import org.thoughtcrime.securesms.groups.GroupId;
@@ -104,7 +105,7 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
if (ringUpdate != CallManager.RingUpdate.REQUESTED) {
SignalDatabase.calls().insertOrUpdateGroupCallFromRingState(ringId, remotePeerGroup.getId(), sender, System.currentTimeMillis(), ringUpdate);
return currentState;
} else if (SignalDatabase.calls().isRingCancelled(ringId)) {
} else if (SignalDatabase.calls().isRingCancelled(ringId, remotePeerGroup.getId())) {
try {
Log.i(TAG, "Incoming ring request for already cancelled ring: " + ringId);
webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, null);
@@ -135,7 +136,7 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
protected @NonNull WebRtcServiceState handleReceivedGroupCallPeekForRingingCheck(@NonNull WebRtcServiceState currentState, @NonNull GroupCallRingCheckInfo info, @NonNull PeekInfo peekInfo) {
Log.i(tag, "handleReceivedGroupCallPeekForRingingCheck(): recipient: " + info.getRecipientId() + " ring: " + info.getRingId());
if (SignalDatabase.calls().isRingCancelled(info.getRingId())) {
if (SignalDatabase.calls().isRingCancelled(info.getRingId(), info.getRecipientId())) {
try {
Log.i(TAG, "Ring was cancelled while getting peek info ring: " + info.getRingId());
webRtcInteractor.getCallManager().cancelGroupRing(info.getGroupId().getDecodedId(), info.getRingId(), null);

View File

@@ -58,7 +58,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
boolean updateForCurrentRingId = ringId == currentState.getCallSetupState(RemotePeer.GROUP_CALL_ID).getRingId();
boolean isCurrentlyRinging = currentState.getCallInfoState().getGroupCallState().isRinging();
if (SignalDatabase.calls().isRingCancelled(ringId)) {
if (SignalDatabase.calls().isRingCancelled(ringId, remotePeerGroup.getId())) {
try {
Log.i(TAG, "Ignoring incoming ring request for already cancelled ring: " + ringId);
webRtcInteractor.getCallManager().cancelGroupRing(groupId.getDecodedId(), ringId, null);