Simplify saving original chat ID

This commit is contained in:
link2xt
2022-10-18 19:15:35 +00:00
parent 2e946a008f
commit 5cf364b55b

View File

@@ -847,22 +847,15 @@ async fn add_parts(
}
}
if is_mdn {
chat_id = Some(DC_CHAT_ID_TRASH);
}
let orig_reaction_chat_id = if is_reaction {
let orig_reaction_chat_id = chat_id;
chat_id = Some(DC_CHAT_ID_TRASH);
orig_reaction_chat_id
} else {
None
};
let chat_id = chat_id.unwrap_or_else(|| {
info!(context, "No chat id for message (TRASH)");
let orig_chat_id = chat_id;
let chat_id = if is_mdn || is_reaction {
DC_CHAT_ID_TRASH
});
} else {
chat_id.unwrap_or_else(|| {
info!(context, "No chat id for message (TRASH)");
DC_CHAT_ID_TRASH
})
};
// Extract ephemeral timer from the message or use the existing timer if the message is not fully downloaded.
let mut ephemeral_timer = if is_partial_download.is_some() {
@@ -1071,7 +1064,7 @@ async fn add_parts(
set_msg_reaction(
context,
&mime_in_reply_to,
orig_reaction_chat_id.unwrap_or_default(),
orig_chat_id.unwrap_or_default(),
from_id,
Reaction::from(part.msg.as_str()),
)