mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 22:06:29 +03:00
fix: Delete resent messages on receiver side (#5155)
If a Delta Chat message has the Message-ID already existing in the db, but a greater "Date", it's a resent message that can be deleted. Messages having the same "Date" mustn't be deleted because they can be already seen messages moved back to INBOX. Also don't delete messages having lesser "Date" to avoid deleting both messages in a multi-device setting.
This commit is contained in:
@@ -883,7 +883,7 @@ mod tests {
|
||||
use crate::chatlist::Chatlist;
|
||||
use crate::config::Config;
|
||||
use crate::contact::Contact;
|
||||
use crate::receive_imf::{receive_imf, receive_imf_inner};
|
||||
use crate::receive_imf::{receive_imf, receive_imf_from_inbox};
|
||||
use crate::test_utils::TestContext;
|
||||
use crate::{message, sql};
|
||||
|
||||
@@ -1216,7 +1216,7 @@ mod tests {
|
||||
let sent2 = alice.pop_sent_msg().await;
|
||||
|
||||
// Bob does not download instance but already receives update
|
||||
receive_imf_inner(
|
||||
receive_imf_from_inbox(
|
||||
&bob,
|
||||
&alice_instance.rfc724_mid,
|
||||
sent1.payload().as_bytes(),
|
||||
@@ -1231,7 +1231,7 @@ mod tests {
|
||||
assert_eq!(bob_instance.download_state, DownloadState::Available);
|
||||
|
||||
// Bob downloads instance, updates should be assigned correctly
|
||||
let received_msg = receive_imf_inner(
|
||||
let received_msg = receive_imf_from_inbox(
|
||||
&bob,
|
||||
&alice_instance.rfc724_mid,
|
||||
sent1.payload().as_bytes(),
|
||||
|
||||
Reference in New Issue
Block a user