mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
feat: add location streaming failure response code
Before `is_sending_location_to_chat` returned a boolean when location was enabled or disabled for a chat. It now returns an enum value representing Enabled, disabled and failure where failure says that its enabled but (currently) not possible. This should not break cffi because 0 is still disabled, 1 enabled and new code 2 (failure) is handled similar to 1.
This commit is contained in:
@@ -2520,8 +2520,10 @@ pub unsafe extern "C" fn dc_is_sending_locations_to_chat(
|
||||
Some(ChatId::new(chat_id))
|
||||
};
|
||||
|
||||
block_on(location::is_sending_locations_to_chat(ctx, chat_id))
|
||||
.unwrap_or_log_default(ctx, "Failed dc_is_sending_locations_to_chat()") as libc::c_int
|
||||
block_on(async {
|
||||
location::is_sending_locations_to_chat(ctx, chat_id).await.map(|res| res as u8)
|
||||
})
|
||||
.unwrap_or_log_default(ctx, "Failed dc_is_sending_locations_to_chat()") as libc::c_int
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user