Exclude invalid long messages from backups.

This commit is contained in:
Greyson Parrelli 2025-01-14 15:27:04 -05:00
parent cdc9d3e07d
commit cc3c75c870

View file

@ -296,6 +296,11 @@ class ChatItemArchiveExporter(
} }
val attachments = extraData.attachmentsById[record.id] val attachments = extraData.attachmentsById[record.id]
if (attachments?.isNotEmpty() == true && attachments.all { it.contentType == MediaUtil.LONG_TEXT } && record.body.isNullOrEmpty()) {
Log.w(TAG, "Record with ID ${record.id} has long text attachments, but no body. Skipping.")
continue
}
val sticker = attachments?.firstOrNull { dbAttachment -> dbAttachment.isSticker } val sticker = attachments?.firstOrNull { dbAttachment -> dbAttachment.isSticker }
if (sticker?.stickerLocator != null) { if (sticker?.stickerLocator != null) {