Update to latest Backup.proto and fix various backup bugs.

This commit is contained in:
Greyson Parrelli
2024-08-09 16:04:47 -04:00
committed by mtang-signal
parent e2e6a73e8d
commit 5ffb7b07da
31 changed files with 761 additions and 2182 deletions

View File

@@ -49,13 +49,14 @@ class ArchivedAttachment : Attachment {
stickerLocator: StickerLocator?,
gif: Boolean,
quote: Boolean,
uuid: UUID?
uuid: UUID?,
fileName: String?
) : super(
contentType = contentType ?: "",
quote = quote,
transferState = AttachmentTable.TRANSFER_NEEDS_RESTORE,
size = size,
fileName = null,
fileName = fileName,
cdn = Cdn.fromCdnNumber(cdn),
remoteLocation = cdnKey,
remoteKey = Base64.encodeWithoutPadding(key),

View File

@@ -46,7 +46,7 @@ enum class Cdn(private val value: Int) {
0 -> CDN_0
2 -> CDN_2
3 -> CDN_3
else -> throw UnsupportedOperationException()
else -> throw UnsupportedOperationException("Invalid CDN number: $cdnNumber")
}
}
}

View File

@@ -83,7 +83,7 @@ class DatabaseAttachment : Attachment {
thumbnailRestoreState: AttachmentTable.ThumbnailRestoreState,
uuid: UUID?
) : super(
contentType = contentType!!,
contentType = contentType,
transferState = transferProgress,
size = size,
fileName = fileName,

View File

@@ -13,7 +13,7 @@ import java.util.UUID
* quote them and know their contentType even though the media has been deleted.
*/
class TombstoneAttachment : Attachment {
constructor(contentType: String, quote: Boolean) : super(
constructor(contentType: String?, quote: Boolean) : super(
contentType = contentType,
quote = quote,
transferState = AttachmentTable.TRANSFER_PROGRESS_DONE,

View File

@@ -14,7 +14,7 @@ class UriAttachment : Attachment {
constructor(
uri: Uri,
contentType: String,
contentType: String?,
transferState: Int,
size: Long,
fileName: String?,
@@ -50,7 +50,7 @@ class UriAttachment : Attachment {
@JvmOverloads
constructor(
dataUri: Uri,
contentType: String,
contentType: String?,
transferState: Int,
size: Long,
width: Int,