Re-enable call delete sync events.

This commit is contained in:
Alex Hart
2023-06-13 13:44:10 -03:00
committed by Cody Henthorne
parent f3a0a059ea
commit 4caaa0033b
2 changed files with 7 additions and 17 deletions

View File

@@ -13,7 +13,6 @@ import org.thoughtcrime.securesms.jobs.protos.CallSyncEventJobRecord
import org.thoughtcrime.securesms.recipients.RecipientId
import org.thoughtcrime.securesms.ringrtc.RemotePeer
import org.thoughtcrime.securesms.service.webrtc.CallEventSyncMessageUtil
import org.thoughtcrime.securesms.util.FeatureFlags
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage
import org.whispersystems.signalservice.internal.push.SignalServiceProtos
import java.util.Optional
@@ -62,12 +61,10 @@ class CallSyncEventJob private constructor(
}
fun enqueueDeleteSyncEvents(deletedCalls: Set<CallTable.Call>) {
if (FeatureFlags.callDeleteSync()) {
deletedCalls.chunked(50).forEach {
ApplicationDependencies.getJobManager().add(
createForDelete(it)
)
}
deletedCalls.chunked(50).forEach {
ApplicationDependencies.getJobManager().add(
createForDelete(it)
)
}
}
@@ -128,12 +125,14 @@ class CallSyncEventJob private constructor(
isOutgoing = callSyncEvent.deserializeDirection() == CallTable.Direction.OUTGOING,
isVideoCall = callType != CallTable.Type.AUDIO_CALL
)
CallTable.Event.DELETE -> CallEventSyncMessageUtil.createDeleteCallEvent(
remotePeer = RemotePeer(callSyncEvent.deserializeRecipientId(), CallId(callSyncEvent.callId)),
timestamp = syncTimestamp,
isOutgoing = callSyncEvent.deserializeDirection() == CallTable.Direction.OUTGOING,
isVideoCall = callType != CallTable.Type.AUDIO_CALL
)
else -> throw Exception("Unsupported event: ${callSyncEvent.event}")
}
}

View File

@@ -107,7 +107,6 @@ public final class FeatureFlags {
private static final String AD_HOC_CALLING = "android.calling.ad.hoc";
private static final String EDIT_MESSAGE_RECEIVE = "android.editMessage.receive";
private static final String EDIT_MESSAGE_SEND = "android.editMessage.send";
private static final String CALL_DELETE_SYNC = "android.calling.deleteSync";
private static final String MAX_ATTACHMENT_COUNT = "android.attachments.maxCount";
private static final String MAX_ATTACHMENT_SIZE_MB = "android.attachments.maxSize";
@@ -176,8 +175,7 @@ public final class FeatureFlags {
@VisibleForTesting
static final Set<String> NOT_REMOTE_CAPABLE = SetUtil.newHashSet(
PHONE_NUMBER_PRIVACY,
AD_HOC_CALLING,
CALL_DELETE_SYNC
AD_HOC_CALLING
);
/**
@@ -608,13 +606,6 @@ public final class FeatureFlags {
return getBoolean(AD_HOC_CALLING, false);
}
/**
* Whether sending deletion sync events is supported
*/
public static boolean callDeleteSync() {
return getBoolean(CALL_DELETE_SYNC, false);
}
/** Maximum number of attachments allowed to be sent/received. */
public static int maxAttachmentCount() {
return getInteger(MAX_ATTACHMENT_COUNT, 32);