From 58f820d640d0ca6cbb113bd588b9ceafcf9ca884 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Mon, 21 Oct 2024 16:08:23 -0300 Subject: [PATCH] Remove check in SignalCallLinkRecord. --- .../storage/CallLinkRecordProcessorTest.kt | 15 --------------- .../api/storage/SignalCallLinkRecord.kt | 6 ------ 2 files changed, 21 deletions(-) diff --git a/app/src/test/java/org/thoughtcrime/securesms/storage/CallLinkRecordProcessorTest.kt b/app/src/test/java/org/thoughtcrime/securesms/storage/CallLinkRecordProcessorTest.kt index 7de669e1cb..06823d3479 100644 --- a/app/src/test/java/org/thoughtcrime/securesms/storage/CallLinkRecordProcessorTest.kt +++ b/app/src/test/java/org/thoughtcrime/securesms/storage/CallLinkRecordProcessorTest.kt @@ -8,7 +8,6 @@ package org.thoughtcrime.securesms.storage import okio.ByteString.Companion.EMPTY import okio.ByteString.Companion.toByteString import org.junit.Assert.assertFalse -import org.junit.Assert.assertThrows import org.junit.BeforeClass import org.junit.Test import org.signal.core.util.logging.Log @@ -74,20 +73,6 @@ class CallLinkRecordProcessorTest { assertFalse(result) } - @Test - fun `Given a proto with both an admin pass key and a deletion timestamp, assert invalid`() { - // GIVEN - val proto = CallLinkRecord.Builder().apply { - rootKey = mockCredentials.linkKeyBytes.toByteString() - adminPasskey = mockCredentials.adminPassBytes!!.toByteString() - deletedAtTimestampMs = System.currentTimeMillis() - }.build() - - assertThrows(IllegalStateException::class.java) { - SignalCallLinkRecord(STORAGE_ID, proto) - } - } - @Test fun `Given a proto with neither an admin pass key nor a deletion timestamp, assert valid`() { // GIVEN diff --git a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/storage/SignalCallLinkRecord.kt b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/storage/SignalCallLinkRecord.kt index f937a6798e..07668e6968 100644 --- a/libsignal-service/src/main/java/org/whispersystems/signalservice/api/storage/SignalCallLinkRecord.kt +++ b/libsignal-service/src/main/java/org/whispersystems/signalservice/api/storage/SignalCallLinkRecord.kt @@ -19,12 +19,6 @@ class SignalCallLinkRecord(private val id: StorageId, private val proto: CallLin val adminPassKey: ByteArray = proto.adminPasskey.toByteArray() val deletionTimestamp: Long = proto.deletedAtTimestampMs - init { - if (deletionTimestamp != 0L && adminPassKey.isNotEmpty()) { - throw IllegalStateException("Cannot have nonzero deletion timestamp ($deletionTimestamp) and admin passkey!") - } - } - fun toProto(): CallLinkRecord { return proto }