Guard against invalid authors in directionless messages in archive export.

This commit is contained in:
Greyson Parrelli
2026-03-03 10:32:19 -05:00
parent 0ad4b3f73e
commit da966753a1
2 changed files with 9 additions and 0 deletions

View File

@@ -155,6 +155,10 @@ object ExportSkips {
return log(sentTimestamp, "An incoming message author did not have an aci or e164.")
}
fun directionlessMessageAuthorDoesNotHaveAciOrE164(sentTimestamp: Long): String {
return log(sentTimestamp, "A directionlessmessage author did not have an aci or e164.")
}
fun outgoingMessageToReleaseNotesChat(sentTimestamp: Long): String {
return log(sentTimestamp, "An outgoing message was sent to the release notes chat.")
}

View File

@@ -1705,6 +1705,11 @@ private fun ChatItem.validateChatItem(exportState: ExportState, selfRecipientId:
return null
}
if (this.directionless != null && this.authorId != selfRecipientId.toLong() && exportState.recipientIdToAci[this.authorId] == null && exportState.recipientIdToE164[this.authorId] == null) {
Log.w(TAG, ExportSkips.directionlessMessageAuthorDoesNotHaveAciOrE164(this.dateSent))
return null
}
if (this.outgoing != null && exportState.releaseNoteRecipientId != null && exportState.threadIdToRecipientId[this.chatId] == exportState.releaseNoteRecipientId) {
Log.w(TAG, ExportSkips.outgoingMessageToReleaseNotesChat(this.dateSent))
return null