mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
pr suggestions
This commit is contained in:
@@ -59,20 +59,20 @@ class LiveLocationManager: NSObject, LiveLocationManagerProtocol, CLLocationMana
|
||||
return true
|
||||
}
|
||||
|
||||
func startLiveLocation(roomID: String, durationMillis: UInt64) async -> Result<Void, LiveLocationManagerError> {
|
||||
func startLiveLocation(roomID: String, duration: Duration) async -> Result<Void, LiveLocationManagerError> {
|
||||
guard case .joined(let roomProxy) = await clientProxy.roomForIdentifier(roomID) else {
|
||||
MXLog.error("Failed to resolve joined room for identifier: \(roomID)")
|
||||
return .failure(.roomNotJoined)
|
||||
}
|
||||
|
||||
let result = await roomProxy.startLiveLocationShare(durationMillis: durationMillis)
|
||||
let result = await roomProxy.startLiveLocationShare(duration: duration)
|
||||
|
||||
guard case .success = result else {
|
||||
MXLog.error("Failed to start live location share in room: \(roomID)")
|
||||
return .failure(.startFailed)
|
||||
}
|
||||
|
||||
let timeoutDate = Date().addingTimeInterval(TimeInterval(durationMillis) / 1000.0)
|
||||
let timeoutDate = Date().addingTimeInterval(TimeInterval(duration.seconds))
|
||||
appSettings.liveLocationSharingTimeoutDatesByRoomID[roomID] = timeoutDate
|
||||
|
||||
return .success(())
|
||||
|
||||
@@ -30,8 +30,8 @@ protocol LiveLocationManagerProtocol: AnyObject {
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - roomID: The identifier of the room to share live location in.
|
||||
/// - durationMillis: The duration in milliseconds for how long the live location should be shared.
|
||||
func startLiveLocation(roomID: String, durationMillis: UInt64) async -> Result<Void, LiveLocationManagerError>
|
||||
/// - duration: How long the live location should be shared.
|
||||
func startLiveLocation(roomID: String, duration: Duration) async -> Result<Void, LiveLocationManagerError>
|
||||
|
||||
/// Stops sharing live location in a room.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user