mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Guard against invalid authors in directionless messages in archive export.
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user