diff --git a/src/chat.rs b/src/chat.rs index 92ae61d55..6accc8ef6 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -745,6 +745,7 @@ fn prepare_msg_common(context: &Context, chat_id: u32, msg: &mut Message) -> Res unarchive(context, chat_id)?; let mut chat = Chat::load_from_db(context, chat_id)?; + ensure!(chat.can_send(), "cannot send to chat #{}", chat_id); // The OutPreparing state is set by dc_prepare_msg() before it // calls this function and the message is left in the OutPreparing