From f1704fbb5777d4b1746aef9ab9a33d31a7855a9f Mon Sep 17 00:00:00 2001 From: Cody Henthorne Date: Thu, 25 Jan 2024 09:36:01 -0500 Subject: [PATCH] Fix file attachment dedup logic. --- .../java/org/thoughtcrime/securesms/database/AttachmentTable.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt b/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt index bfd9df5a2f..6e81b0529f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/AttachmentTable.kt @@ -1234,7 +1234,7 @@ class AttachmentTable( } val isUsedElsewhere = isAttachmentFileUsedByOtherAttachments(attachmentId, dataInfo) - val isSameQuality = transformProperties?.sentMediaQuality == sharedDataInfo.transformProperties?.sentMediaQuality + val isSameQuality = (transformProperties?.sentMediaQuality ?: 0) == (sharedDataInfo.transformProperties?.sentMediaQuality ?: 0) Log.i(TAG, "[deduplicateAttachment] Potential duplicate data file found. usedElsewhere: " + isUsedElsewhere + " sameQuality: " + isSameQuality + " otherFile: " + sharedDataInfo.file.absolutePath)