Fix recipient on some update messages when exporting.
This commit is contained in:
parent
6928c22477
commit
9823563ef7
1 changed files with 4 additions and 4 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Reference in a new issue