Fix handling of stickers with invalid locators in backups.

This commit is contained in:
Greyson Parrelli
2024-09-21 09:59:09 -04:00
parent 3c0e9c9e4e
commit f3a9f7f91d
2 changed files with 4 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import android.net.Uri
import android.os.Parcel import android.os.Parcel
import org.thoughtcrime.securesms.blurhash.BlurHash import org.thoughtcrime.securesms.blurhash.BlurHash
import org.thoughtcrime.securesms.database.AttachmentTable import org.thoughtcrime.securesms.database.AttachmentTable
import org.thoughtcrime.securesms.stickers.StickerLocator
import java.util.UUID import java.util.UUID
/** /**
@@ -53,6 +54,7 @@ class TombstoneAttachment : Attachment {
voiceNote: Boolean = false, voiceNote: Boolean = false,
borderless: Boolean = false, borderless: Boolean = false,
gif: Boolean = false, gif: Boolean = false,
stickerLocator: StickerLocator? = null,
quote: Boolean, quote: Boolean,
uuid: UUID? uuid: UUID?
) : super( ) : super(
@@ -76,7 +78,7 @@ class TombstoneAttachment : Attachment {
incrementalMacChunkSize = incrementalMacChunkSize ?: 0, incrementalMacChunkSize = incrementalMacChunkSize ?: 0,
uploadTimestamp = 0, uploadTimestamp = 0,
caption = caption, caption = caption,
stickerLocator = null, stickerLocator = stickerLocator,
blurHash = BlurHash.parseOrNull(blurHash), blurHash = BlurHash.parseOrNull(blurHash),
audioHash = null, audioHash = null,
transformProperties = null, transformProperties = null,

View File

@@ -83,6 +83,7 @@ fun FilePointer?.toLocalAttachment(
borderless = borderless, borderless = borderless,
gif = gif, gif = gif,
quote = false, quote = false,
stickerLocator = stickerLocator,
uuid = UuidUtil.fromByteStringOrNull(uuid) uuid = UuidUtil.fromByteStringOrNull(uuid)
) )
} else if (this.backupLocator != null) { } else if (this.backupLocator != null) {