matrix_sdk_ffi/live_location_share.rs
1// Copyright 2024 The Matrix.org Foundation C.I.C.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14use crate::ruma::LocationContent;
15#[derive(uniffi::Record)]
16pub struct LastLocation {
17 /// The most recent location content of the user.
18 pub location: LocationContent,
19 /// A timestamp in milliseconds since Unix Epoch on that day in local
20 /// time.
21 pub ts: u64,
22}
23/// Details of a users live location share.
24#[derive(uniffi::Record)]
25pub struct LiveLocationShare {
26 /// The user's last known location.
27 pub last_location: LastLocation,
28 /// The live status of the live location share.
29 pub(crate) is_live: bool,
30 /// The user ID of the person sharing their live location.
31 pub user_id: String,
32}