Do not allow to save drafts in non-writeable chats, fix #1986 (#1997)

This commit is contained in:
Hocuri
2020-10-19 13:15:48 +02:00
committed by GitHub
parent 3c6d52842e
commit c005f756d6
3 changed files with 24 additions and 0 deletions

View File

@@ -460,6 +460,12 @@ impl ChatId {
msg.param.set(Param::File, blob.as_name());
}
}
let chat = Chat::load_from_db(context, self).await?;
if !chat.can_send() {
bail!("Can't set a draft: Can't send");
}
context
.sql
.execute(