mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +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,
|
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)]
|
#[derive(Copy, Clone)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct dc_kml_t {
|
pub struct dc_kml_t {
|
||||||
@@ -37,6 +54,17 @@ pub struct dc_kml_t {
|
|||||||
pub curr: dc_location,
|
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
|
// location streaming
|
||||||
pub unsafe fn dc_send_locations_to_chat(
|
pub unsafe fn dc_send_locations_to_chat(
|
||||||
context: &Context,
|
context: &Context,
|
||||||
|
|||||||
Reference in New Issue
Block a user