Skip to content

Commit ca6bf65

Browse files
committed
on download full message: merge new params into old params and remove
full-message metadata params
1 parent f5577d9 commit ca6bf65

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/receive_imf.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,13 +2347,19 @@ async fn handle_full_message(
23472347
.param
23482348
.get_bool(Param::GuaranteeE2ee)
23492349
.unwrap_or_default();
2350+
23502351
if edit_msg_showpadlock || !original_msg.get_showpadlock() {
2352+
let mut new_params = original_msg.param.clone();
2353+
new_params
2354+
.merge_in_from_params(part.param.clone())
2355+
.remove(Param::FullMessageFileBytes)
2356+
.remove(Param::FullMessageViewtype);
23512357
context
23522358
.sql
23532359
.execute(
23542360
"UPDATE msgs SET param=?, type=?, bytes=?, error=?, download_state=? WHERE id=?",
23552361
(
2356-
part.param.to_string(),
2362+
new_params.to_string(),
23572363
part.typ,
23582364
part.bytes as isize,
23592365
part.error.as_deref().unwrap_or_default(),

0 commit comments

Comments
 (0)