mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
Log the reason when the message cannot be sent to the chat
This commit is contained in:
@@ -360,7 +360,9 @@ impl Context {
|
||||
}
|
||||
|
||||
let chat = Chat::load_from_db(self, instance.chat_id).await?;
|
||||
ensure!(chat.can_send(self).await?, "cannot send to {}", chat.id);
|
||||
if let Some(reason) = chat.why_cant_send(self).await? {
|
||||
bail!("cannot send to {}: {}", chat.id, reason);
|
||||
}
|
||||
|
||||
let send_now = !matches!(
|
||||
instance.state,
|
||||
|
||||
Reference in New Issue
Block a user