diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 89a5428ff..cb8a1d0d5 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -1743,7 +1743,7 @@ pub unsafe extern "C" fn dc_set_location( let ffi_context = &*context; ffi_context .with_inner(|ctx| location::set(ctx, latitude, longitude, accuracy)) - .unwrap_or(0) + .unwrap_or(false) as _ } #[no_mangle] diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs index 99de0f4a3..e32878e0b 100644 --- a/examples/repl/cmdline.rs +++ b/examples/repl/cmdline.rs @@ -746,7 +746,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E let longitude = arg2.parse()?; let continue_streaming = location::set(context, latitude, longitude, 0.); - if 0 != continue_streaming { + if continue_streaming { println!("Success, streaming should be continued."); } else { println!("Success, streaming can be stoppped."); diff --git a/src/location.rs b/src/location.rs index 457aa495b..d0c3bdc8c 100644 --- a/src/location.rs +++ b/src/location.rs @@ -257,9 +257,9 @@ pub fn is_sending_locations_to_chat(context: &Context, chat_id: u32) -> bool { .unwrap_or_default() } -pub fn set(context: &Context, latitude: f64, longitude: f64, accuracy: f64) -> libc::c_int { +pub fn set(context: &Context, latitude: f64, longitude: f64, accuracy: f64) -> bool { if latitude == 0.0 && longitude == 0.0 { - return 1; + return true; } let mut continue_streaming = false; @@ -293,7 +293,7 @@ pub fn set(context: &Context, latitude: f64, longitude: f64, accuracy: f64) -> l schedule_MAYBE_SEND_LOCATIONS(context, 0); } - continue_streaming as libc::c_int + continue_streaming } pub fn get_range(