mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
performance: skip a costly call to chat.why_cant_send_ex()
This commit is contained in:
@@ -2691,9 +2691,7 @@ async fn prepare_send_msg(
|
|||||||
CantSendReason::InBroadcast => {
|
CantSendReason::InBroadcast => {
|
||||||
matches!(
|
matches!(
|
||||||
msg.param.get_cmd(),
|
msg.param.get_cmd(),
|
||||||
SystemMessage::MemberRemovedFromGroup
|
SystemMessage::MemberRemovedFromGroup | SystemMessage::SecurejoinMessage
|
||||||
| SystemMessage::SecurejoinMessage
|
|
||||||
| SystemMessage::WebxdcStatusUpdate
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
CantSendReason::MissingKey => msg
|
CantSendReason::MissingKey => msg
|
||||||
@@ -2702,7 +2700,9 @@ async fn prepare_send_msg(
|
|||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
if let Some(reason) = chat.why_cant_send_ex(context, &skip_fn).await? {
|
if msg.param.get_cmd() == SystemMessage::WebxdcStatusUpdate {
|
||||||
|
// Already checked in `send_webxdc_status_update_struct()`.
|
||||||
|
} else if let Some(reason) = chat.why_cant_send_ex(context, &skip_fn).await? {
|
||||||
bail!("Cannot prepare sending to {chat_id}: {reason}");
|
bail!("Cannot prepare sending to {chat_id}: {reason}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user