mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Make epoch optional in backups and storage service.
This commit is contained in:
committed by
Greyson Parrelli
parent
47faefaff7
commit
c4c9fd9f65
@@ -6,7 +6,6 @@
|
||||
package org.thoughtcrime.securesms.backup.v2.database
|
||||
|
||||
import android.database.Cursor
|
||||
import okio.ByteString
|
||||
import okio.ByteString.Companion.toByteString
|
||||
import org.signal.core.util.nullIfEmpty
|
||||
import org.signal.ringrtc.CallLinkState
|
||||
@@ -41,7 +40,7 @@ class CallLinkArchiveExporter(private val cursor: Cursor) : Iterator<ArchiveReci
|
||||
id = callLink.recipientId.toLong(),
|
||||
callLink = CallLink(
|
||||
rootKey = callLink.credentials!!.linkKeyBytes.toByteString(),
|
||||
epoch = callLink.credentials.epochBytes?.toByteString() ?: ByteString.EMPTY,
|
||||
epoch = callLink.credentials.epochBytes?.takeIf { it.isNotEmpty() }?.toByteString(),
|
||||
adminKey = callLink.credentials.adminPassBytes?.toByteString()?.nullIfEmpty(),
|
||||
name = callLink.state.name,
|
||||
expirationMs = expirationTime.takeIf { it != Long.MAX_VALUE }?.clampToValidBackupRange() ?: 0,
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.thoughtcrime.securesms.backup.v2.importer
|
||||
|
||||
import org.signal.core.util.isEmpty
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.core.util.nullIfEmpty
|
||||
import org.signal.ringrtc.CallLinkRootKey
|
||||
import org.signal.ringrtc.CallLinkState
|
||||
import org.thoughtcrime.securesms.backup.v2.ArchiveCallLink
|
||||
@@ -45,7 +44,7 @@ object CallLinkArchiveImporter {
|
||||
roomId = CallLinkRoomId.fromCallLinkRootKey(rootKey),
|
||||
credentials = CallLinkCredentials(
|
||||
callLink.rootKey.toByteArray(),
|
||||
callLink.epoch?.nullIfEmpty()?.toByteArray(),
|
||||
callLink.epoch?.toByteArray(),
|
||||
callLink.adminKey?.toByteArray()
|
||||
),
|
||||
state = SignalCallLinkState(
|
||||
|
||||
Reference in New Issue
Block a user