mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
refactor: use let-else in resend_msgs()
This commit is contained in:
@@ -3604,7 +3604,10 @@ pub async fn resend_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
|
|||||||
msgs.push(msg)
|
msgs.push(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(chat_id) = chat_id {
|
let Some(chat_id) = chat_id else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
let chat = Chat::load_from_db(context, chat_id).await?;
|
let chat = Chat::load_from_db(context, chat_id).await?;
|
||||||
for mut msg in msgs {
|
for mut msg in msgs {
|
||||||
if msg.get_showpadlock() && !chat.is_protected() {
|
if msg.get_showpadlock() && !chat.is_protected() {
|
||||||
@@ -3628,7 +3631,6 @@ pub async fn resend_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user