-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Sort received outgoing message down if it's fresher than all non fresh messages #5800
Conversation
bee519d
to
c349908
Compare
c349908
to
254f6c4
Compare
Why does this happen? If we download messages in order, then message is usually newer than all messages received so far. Does this PR try to fix some case where messages are pulled from Sent folder when used together with non-DC client? |
This may happen if Sentbox is fetched after Inbox, let msg_incoming = receive_imf(
&alice,
b"From: Bob <bob@example.net>\n\
To: alice@example.org\n\
Message-ID: <1234-2-3@example.org>\n\
Date: Sun, 08 Dec 2019 19:00:27 +0000\n\
\n\
Thanks, Alice!\n",
true,
)
.await?
.unwrap();
let msg_sent = receive_imf(
&alice,
b"From: alice@example.org\n\
To: Bob <bob@example.net>\n\
Message-ID: <1234-2-4@example.org>\n\
Date: Sat, 07 Dec 2019 19:00:27 +0000\n\
\n\
Happy birthday, Bob!\n",
true,
)
.await?
.unwrap(); Of course Delta Chat doesn't always look into folders in this order, it may fetch Sentbox messages first, and if we change the test this way and also give the Sentbox message later Date e.g.
No, it only tries to add new outgoing messages (e.g. from other devices) to the of the chat when possible, if they are delayed for any reason. At least they should appear in the chat under messages sent from the current device. I rather try to keep the current behaviour when old messages are pulled from Sentbox. EDIT: Not sure about adding |
|
So this is a fix for Gmail? On most providers outgoing messages from Delta Chat never appears in the Sent folder, they are BCC-ed to self and arrive into the Inbox. |
This PR is a fix for multi-device, it makes received outgoing messages appear in the bottom of the chat even if they have Date earlier than messages sent from the current device, to make them more visible. This may happen if messages are delayed because of network problems or clocks are not synchronised. Before that was done only for incoming messages. As for Gmail, particularly if Delta Chat is used together with Gmail client, there's another problem -- Sentbox messages may appear before Inbox ones even if the latter are older and this can be fixed by introducing some |
Actually this is an heuristic in this PR in order not to break the Gmail case simulated by |
254f6c4
to
8ce9b41
Compare
8ce9b41
to
7de1856
Compare
f2951d8
to
716e908
Compare
716e908
to
c55967b
Compare
Didn't expect that, but this is incompatible with 796b0d7, need to debug. EDIT: Can't reproduce the |
9b8a432
to
3214eb6
Compare
…n fresh messages Received messages shouldn't mingle with just sent ones and appear somewhere in the middle of the chat, so we go after the newest non fresh message. But if a received outgoing message is older than some `InSeen` message, better sort the received message purely by timestamp (this is an heuristic in order not to break the Gmail-like case simulated by `verified_chats::test_old_message_4()`). We could place the received message just before that `InSeen` message, but anyway the user may not notice it. At least this fixes outgoing messages sorting for shared accounts where messages from other devices should be sorted the same way as incoming ones.
3214eb6
to
6c01309
Compare
Only |
No description provided.