Add validations to ensure some simple chat updates are exported properly.

This commit is contained in:
Greyson Parrelli
2025-10-29 16:44:53 -04:00
committed by Michelle Tang
parent 765c1eeab0
commit 179bd17680

View File

@@ -265,22 +265,22 @@ class ChatItemArchiveExporter(
}
MessageTypes.isReportedSpam(record.type) -> {
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.REPORTED_SPAM)
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.REPORTED_SPAM).takeIf { builder.authorId == selfRecipientId.toLong() }
transformTimer.emit("simple-update")
}
MessageTypes.isMessageRequestAccepted(record.type) -> {
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.MESSAGE_REQUEST_ACCEPTED)
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.MESSAGE_REQUEST_ACCEPTED).takeIf { builder.authorId == selfRecipientId.toLong() }
transformTimer.emit("simple-update")
}
MessageTypes.isBlocked(record.type) -> {
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.BLOCKED)
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.BLOCKED).takeIf { builder.authorId == selfRecipientId.toLong() }
transformTimer.emit("simple-update")
}
MessageTypes.isUnblocked(record.type) -> {
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.UNBLOCKED)
builder.updateMessage = simpleUpdate(SimpleChatUpdate.Type.UNBLOCKED).takeIf { builder.authorId == selfRecipientId.toLong() }
transformTimer.emit("simple-update")
}