mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
Update SDK to 26.04.23 (#5478)
updated sdk, and added error management on the send LLS API
This commit is contained in:
@@ -755,7 +755,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
// MARK: - Live Location
|
||||
|
||||
func makeLiveLocationService() async -> RoomLiveLocationServiceProtocol {
|
||||
await RoomLiveLocationService(liveLocationShares: room.liveLocationShares())
|
||||
await RoomLiveLocationService(liveLocationsObserver: room.liveLocationsObserver())
|
||||
}
|
||||
|
||||
func startLiveLocationShare(duration: Duration) async -> Result<Void, RoomProxyError> {
|
||||
@@ -772,6 +772,16 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
do {
|
||||
try await room.sendLiveLocation(geoUri: geoURI.string)
|
||||
return .success(())
|
||||
} catch let error as LiveLocationError {
|
||||
switch error {
|
||||
case .Network:
|
||||
MXLog.error("Failed sending live location with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
// We can consider the session not active for any error other the Network one.
|
||||
default:
|
||||
MXLog.error("Failed sending live location, session is not active")
|
||||
return .failure(.liveLocationSessionIsNotActive)
|
||||
}
|
||||
} catch {
|
||||
MXLog.error("Failed sending live location with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
|
||||
@@ -20,6 +20,7 @@ enum RoomProxyError: Error {
|
||||
case missingTransactionID
|
||||
case failedCreatingPinnedTimeline
|
||||
case timelineError(TimelineProxyError)
|
||||
case liveLocationSessionIsNotActive
|
||||
}
|
||||
|
||||
/// An enum that describes the relationship between the current user and the room, and contains a reference to the specific implementation of the `RoomProxy`.
|
||||
|
||||
Reference in New Issue
Block a user