Use URL for S3.

Thanks to Oscar Mira <valldrac@molly.im> for bringing this to our attention.
This commit is contained in:
Cody Henthorne
2024-06-20 12:15:49 -04:00
committed by GitHub
parent 4b8546a151
commit 230de7e9dc
3 changed files with 59 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ import org.signal.libsignal.protocol.message.DecryptionErrorMessage
import org.signal.libsignal.zkgroup.groups.GroupMasterKey
import org.signal.storageservice.protos.groups.local.DecryptedGroupChange
import org.thoughtcrime.securesms.attachments.Attachment
import org.thoughtcrime.securesms.attachments.Cdn
import org.thoughtcrime.securesms.attachments.PointerAttachment
import org.thoughtcrime.securesms.database.model.StoryType
import org.thoughtcrime.securesms.groups.GroupId
@@ -175,7 +176,12 @@ object SignalServiceProtoUtil {
fun AttachmentPointer.toPointer(stickerLocator: StickerLocator? = null): Attachment? {
return try {
PointerAttachment.forPointer(Optional.of(toSignalServiceAttachmentPointer()), stickerLocator).orNull()
val pointer = PointerAttachment.forPointer(Optional.of(toSignalServiceAttachmentPointer()), stickerLocator).orNull()
if (pointer?.cdn != Cdn.S3) {
pointer
} else {
null
}
} catch (e: InvalidMessageStructureException) {
null
}