Update to libsignal 0.60.0

This commit is contained in:
Greyson Parrelli
2024-10-25 16:09:03 -04:00
parent 4282d88191
commit 22148550dc
353 changed files with 33 additions and 5 deletions

View File

@@ -8,6 +8,8 @@ package org.thoughtcrime.securesms.backup.v2
import androidx.annotation.WorkerThread
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okio.ByteString
import okio.ByteString.Companion.toByteString
import org.greenrobot.eventbus.EventBus
import org.signal.core.util.Base64
import org.signal.core.util.EventTimer
@@ -365,7 +367,8 @@ object BackupRepository {
writer.write(
BackupInfo(
version = VERSION,
backupTimeMs = exportState.backupTime
backupTimeMs = exportState.backupTime,
mediaRootBackupKey = SignalStore.backup.mediaRootBackupKey?.toByteString() ?: ByteString.EMPTY
)
)
frameCount++
@@ -554,6 +557,8 @@ object BackupRepository {
return ImportResult.Failure
}
SignalStore.backup.mediaRootBackupKey = header.mediaRootBackupKey.toByteArray()
// Add back self after clearing data
val selfId: RecipientId = SignalDatabase.recipients.getAndPossiblyMerge(selfData.aci, selfData.pni, selfData.e164, pniVerified = true, changeSelf = true)
SignalDatabase.recipients.setProfileKey(selfId, selfData.profileKey)
@@ -736,7 +741,7 @@ object BackupRepository {
return initBackupAndFetchAuth(backupKey)
.map { credential ->
val zkCredential = SignalNetwork.archive.getZkCredential(backupKey, aci, credential)
if (zkCredential.backupLevel == BackupLevel.MEDIA) {
if (zkCredential.backupLevel == BackupLevel.PAID) {
MessageBackupTier.PAID
} else {
MessageBackupTier.FREE

View File

@@ -980,6 +980,7 @@ class ChatItemArchiveImporter(
}
private fun Quote.QuotedAttachment.toLocalAttachment(): Attachment? {
// TODO [backup] quote status not passed through?
val thumbnail = this.thumbnail?.toLocalAttachment()
if (thumbnail != null) {
@@ -990,6 +991,7 @@ class ChatItemArchiveImporter(
return null
}
// TODO [backup] Need to do the normal ArchiveAttachment thing -- not sure why the conversion to a pointer
return PointerAttachment.forPointer(
quotedAttachment = DataMessage.Quote.QuotedAttachment(
contentType = this.contentType,