fix: Don't update timestamp, timestamp_rcvd, state when replacing partially downloaded message (#4700)

Also add a test on downloading a message later. Although it doesn't reproduce #4700 for some reason,
it fails w/o the fix because before a message state was changing to `InSeen` after a full download
which doesn't look correct. The result of a full message download should be such as if it was fully
downloaded initially.
This commit is contained in:
iequidoo
2023-09-25 13:07:37 -03:00
committed by iequidoo
parent f279730b0f
commit 5f00fc4e27
3 changed files with 50 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ use crate::{job_try, stock_str, EventType};
/// eg. to assign them to the correct chat.
/// As these messages are typically small,
/// they're caught by `MIN_DOWNLOAD_LIMIT`.
const MIN_DOWNLOAD_LIMIT: u32 = 32768;
pub(crate) const MIN_DOWNLOAD_LIMIT: u32 = 32768;
/// If a message is downloaded only partially
/// and `delete_server_after` is set to small timeouts (eg. "at once"),