Merge pull request #749 from deltachat/fix-get-chat-id

let dc_get_chat_id_by_contact_id() returns 0 if no chat is found
This commit is contained in:
Alexander Krotov
2019-10-27 12:42:22 +00:00
committed by GitHub

View File

@@ -715,10 +715,7 @@ pub unsafe extern "C" fn dc_get_chat_id_by_contact_id(
}
let ffi_context = &*context;
ffi_context
.with_inner(|ctx| {
chat::get_by_contact_id(ctx, contact_id)
.unwrap_or_log_default(ctx, "Failed to get chat")
})
.with_inner(|ctx| chat::get_by_contact_id(ctx, contact_id).unwrap_or(0))
.unwrap_or(0)
}