mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Make get_draft() return Ok(None) when called for a special chat id
This commit is contained in:
@@ -925,7 +925,9 @@ fn get_draft_msg_id(context: &Context, chat_id: u32) -> u32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_draft(context: &Context, chat_id: u32) -> Result<Option<Message>, Error> {
|
pub fn get_draft(context: &Context, chat_id: u32) -> Result<Option<Message>, Error> {
|
||||||
ensure!(chat_id > DC_CHAT_ID_LAST_SPECIAL, "Invalid chat ID");
|
if chat_id <= DC_CHAT_ID_LAST_SPECIAL {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
let draft_msg_id = get_draft_msg_id(context, chat_id);
|
let draft_msg_id = get_draft_msg_id(context, chat_id);
|
||||||
if draft_msg_id == 0 {
|
if draft_msg_id == 0 {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
|
|||||||
Reference in New Issue
Block a user