mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
Implement dc_location::new() and dc_kml_t::new()
This commit is contained in:
committed by
Floris Bruynooghe
parent
a791f76e4b
commit
b0ef825e67
@@ -28,6 +28,23 @@ pub struct dc_location {
|
||||
pub independent: uint32_t,
|
||||
}
|
||||
|
||||
impl dc_location {
|
||||
pub fn new() -> Self {
|
||||
dc_location {
|
||||
location_id: 0,
|
||||
latitude: 0.0,
|
||||
longitude: 0.0,
|
||||
accuracy: 0.0,
|
||||
timestamp: 0,
|
||||
contact_id: 0,
|
||||
msg_id: 0,
|
||||
chat_id: 0,
|
||||
marker: std::ptr::null_mut(),
|
||||
independent: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct dc_kml_t {
|
||||
@@ -37,6 +54,17 @@ pub struct dc_kml_t {
|
||||
pub curr: dc_location,
|
||||
}
|
||||
|
||||
impl dc_kml_t {
|
||||
pub fn new() -> Self {
|
||||
dc_kml_t {
|
||||
addr: std::ptr::null_mut(),
|
||||
locations: std::ptr::null_mut(),
|
||||
tag: 0,
|
||||
curr: dc_location::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// location streaming
|
||||
pub unsafe fn dc_send_locations_to_chat(
|
||||
context: &Context,
|
||||
|
||||
Reference in New Issue
Block a user