mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
Return Vec<dc_location> from dc_get_locations
This commit is contained in:
committed by
holger krekel
parent
d4dfc5443c
commit
37622af55a
@@ -3,7 +3,6 @@ use std::ffi::CString;
|
||||
use crate::constants::Event;
|
||||
use crate::constants::*;
|
||||
use crate::context::*;
|
||||
use crate::dc_array::*;
|
||||
use crate::dc_chat::*;
|
||||
use crate::dc_job::*;
|
||||
use crate::dc_msg::*;
|
||||
@@ -201,7 +200,7 @@ pub fn dc_get_locations(
|
||||
contact_id: uint32_t,
|
||||
timestamp_from: i64,
|
||||
mut timestamp_to: i64,
|
||||
) -> *mut dc_array_t {
|
||||
) -> Vec<dc_location> {
|
||||
if timestamp_to == 0 {
|
||||
timestamp_to = time() + 10;
|
||||
}
|
||||
@@ -252,10 +251,10 @@ pub fn dc_get_locations(
|
||||
for location in locations {
|
||||
ret.push(location?);
|
||||
}
|
||||
Ok(dc_array_t::from(ret).into_raw())
|
||||
Ok(ret)
|
||||
},
|
||||
)
|
||||
.unwrap_or_else(|_| std::ptr::null_mut())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
fn is_marker(txt: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user