Drop quotes with unexported authors during backup export.

This commit is contained in:
Greyson Parrelli
2026-02-24 14:40:21 -05:00
committed by Cody Henthorne
parent 92a9f12b58
commit ba03ca5e0c
2 changed files with 9 additions and 0 deletions

View File

@@ -214,6 +214,10 @@ object ExportOddities {
return log(0, "Distribution list had self as a member. Removing it.")
}
fun quoteAuthorNotFound(sentTimestamp: Long): String {
return log(sentTimestamp, "Quote author was not found in the exported recipients. Removing the quote.")
}
fun emptyQuote(sentTimestamp: Long): String {
return log(sentTimestamp, "Quote had no text or attachments. Removing it.")
}

View File

@@ -1174,6 +1174,11 @@ private fun BackupMessageRecord.toRemoteQuote(exportState: ExportState, attachme
return null
}
if (!exportState.recipientIds.contains(this.quoteAuthor)) {
Log.w(TAG, ExportOddities.quoteAuthorNotFound(this.dateSent))
return null
}
val localType = QuoteModel.Type.fromCode(this.quoteType)
val remoteType = when (localType) {
QuoteModel.Type.NORMAL -> {