mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 09:56:35 +03:00
api: don't load trashed messages with Message::load_from_db
API now pretends that trashed messages don't exist. This way callers don't have to check if loaded message belongs to trash chat. If message may be trashed by the time it is attempted to be loaded, callers should use Message::load_from_db_optional. Most changes are around receive_status_update() function because previously it relied on loading trashed status update messages immediately after adding them to the database.
This commit is contained in:
@@ -571,7 +571,7 @@ mod tests {
|
||||
let sent_msg = alice.pop_sent_msg().await;
|
||||
let alice2 = TestContext::new_alice().await;
|
||||
alice2.set_config_bool(Config::SyncMsgs, true).await?;
|
||||
alice2.recv_msg(&sent_msg).await;
|
||||
alice2.recv_msg_trash(&sent_msg).await;
|
||||
assert!(token::exists(&alice2, token::Namespace::Auth, "testtoken").await?);
|
||||
assert_eq!(Chatlist::try_load(&alice2, 0, None, None).await?.len(), 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user