dc_receive_imf: delete all message parts if message should be deleted

DeleteMsgOnImap deletes files from the server only when the last part
is deleted. Removing only the first part of the hidden or trashed
message does not result in message deletion.
This commit is contained in:
Alexander Krotov
2020-02-24 16:45:52 +03:00
parent 2cf9c68040
commit 4f4241ba3a

View File

@@ -194,13 +194,15 @@ pub fn dc_receive_imf(
// if we delete we don't need to try moving messages
if needs_delete_job && !created_db_entries.is_empty() {
job_add(
context,
Action::DeleteMsgOnImap,
created_db_entries[0].1.to_u32() as i32,
Params::new(),
0,
);
for db_entry in &created_db_entries {
job_add(
context,
Action::DeleteMsgOnImap,
db_entry.1.to_u32() as i32,
Params::new(),
0,
);
}
} else {
context.do_heuristics_moves(server_folder.as_ref(), insert_msg_id);
}