mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
This fixes a scenario when an outgoing reply is received earlier than an incoming message for some reason like device B having `MvboxMove` enabled, sending the reply and going offline immediately, so the reply is in Inbox and it's processed by device A earlier because e.g. `MvboxMove` is disabled on it. Also if we add multi-transport later, this scenario will be just normal. This allows received outgoing messages to mingle with fresh incoming ones, i.e. sorts them together purely by timestamp by assigning `InFresh` state to received outgoing messages, but still returning `OutDelivered` by all APIs for compatibility. NB: We already do such a trick for `OutMdnRcvd`. As for messages sent locally, there's no need to make them more noticeable even if they are newer, so received outgoing messages are always added after them.