From 5a11551b4d7f920588104ea74e21dcdc37c4536a Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Tue, 5 Nov 2019 13:52:01 +0100 Subject: [PATCH] block sending to chats that do not support sending (normally, this should already be avoided in the ui) --- src/chat.rs | 1 + 1 file changed, 1 insertion(+) 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