pr suggestions

This commit is contained in:
Mauro Romito
2026-04-14 13:56:05 +02:00
committed by Mauro
parent facba008e7
commit a40fab5f5e
10 changed files with 115 additions and 130 deletions
@@ -8,21 +8,22 @@
import Foundation
import MatrixRustSDK
struct LiveLocationShareProxy: Hashable {
struct LiveLocationShare: Hashable {
let userID: String
let geoURI: GeoURI?
let timestamp: Date
let timeoutDate: Date
}
extension LiveLocationShareProxy {
init(liveLocationShare: LiveLocationShare) {
init(userID: String, geoURI: GeoURI?, timestamp: Date, timeoutDate: Date) {
self.userID = userID
self.geoURI = geoURI
self.timestamp = timestamp
self.timeoutDate = timeoutDate
}
init(liveLocationShare: MatrixRustSDK.LiveLocationShare) {
userID = liveLocationShare.userId
if let geoURI = liveLocationShare.lastLocation?.location.geoUri {
self.geoURI = GeoURI(string: geoURI)
} else {
geoURI = nil
}
geoURI = (liveLocationShare.lastLocation?.location.geoUri).flatMap(GeoURI.init(string:))
timestamp = Date(timeIntervalSince1970: Double(liveLocationShare.startTs))
timeoutDate = timestamp.addingTimeInterval(Double(liveLocationShare.timeout) / 1000)
}