Fix recipient on some update messages when exporting.

This commit is contained in:
Greyson Parrelli 2025-01-22 16:59:08 -05:00
parent 6928c22477
commit 9823563ef7

View file

@ -432,10 +432,10 @@ private fun BackupMessageRecord.toBasicChatItemBuilder(selfRecipientId: Recipien
// If a user restores a backup with a different number, then they'll have outgoing messages from a non-self contact. // If a user restores a backup with a different number, then they'll have outgoing messages from a non-self contact.
// We want to ensure all outgoing messages are from ourselves. // We want to ensure all outgoing messages are from ourselves.
val fromRecipientId = if (direction == Direction.OUTGOING) { val fromRecipientId = when {
selfRecipientId.toLong() direction == Direction.OUTGOING -> selfRecipientId.toLong()
} else { direction == Direction.DIRECTIONLESS && MessageTypes.isOutgoingMessageType(record.type) -> selfRecipientId.toLong()
record.fromRecipientId else -> record.fromRecipientId
} }
val builder = ChatItem.Builder().apply { val builder = ChatItem.Builder().apply {