mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Update SDK to 1.0.94-alpha (#1232)
* Update SDK * Map new location fields * Add LocationRoomTimelineItemContent.AssetType
This commit is contained in:
@@ -118,7 +118,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
switch timelineItem {
|
||||
case let item as LocationRoomTimelineItem:
|
||||
guard let geoURI = item.content.geoURI else { return .none }
|
||||
return .displayLocation(body: item.content.body, geoURI: geoURI)
|
||||
return .displayLocation(body: item.content.body, geoURI: geoURI, description: item.content.description)
|
||||
default:
|
||||
return await displayMediaActionIfPossible(timelineItem: timelineItem)
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ enum RoomTimelineControllerCallback {
|
||||
|
||||
enum RoomTimelineControllerAction {
|
||||
case displayMediaFile(file: MediaFileHandleProxy, title: String?)
|
||||
case displayLocation(body: String, geoURI: GeoURI)
|
||||
case displayLocation(body: String, geoURI: GeoURI, description: String?)
|
||||
case none
|
||||
}
|
||||
|
||||
|
||||
+20
@@ -17,4 +17,24 @@
|
||||
struct LocationRoomTimelineItemContent: Hashable {
|
||||
let body: String
|
||||
let geoURI: GeoURI?
|
||||
let description: String?
|
||||
let zoomLevel: UInt8?
|
||||
let asset: AssetType?
|
||||
|
||||
enum AssetType {
|
||||
case sender
|
||||
case pin
|
||||
}
|
||||
|
||||
init(body: String,
|
||||
geoURI: GeoURI? = nil,
|
||||
description: String? = nil,
|
||||
zoomLevel: UInt8? = nil,
|
||||
asset: AssetType? = nil) {
|
||||
self.body = body
|
||||
self.geoURI = geoURI
|
||||
self.description = description
|
||||
self.zoomLevel = zoomLevel
|
||||
self.asset = asset
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,7 +399,11 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
}
|
||||
|
||||
private func buildLocationTimelineItemContent(_ locationContent: LocationContent) -> LocationRoomTimelineItemContent {
|
||||
LocationRoomTimelineItemContent(body: locationContent.body, geoURI: .init(string: locationContent.geoUri))
|
||||
LocationRoomTimelineItemContent(body: locationContent.body,
|
||||
geoURI: .init(string: locationContent.geoUri),
|
||||
description: locationContent.description,
|
||||
zoomLevel: locationContent.zoomLevel,
|
||||
asset: locationContent.asset.map { .init(assetType: $0) })
|
||||
}
|
||||
|
||||
private func buildFileTimelineItemContent(_ messageContent: FileMessageContent) -> FileRoomTimelineItemContent {
|
||||
@@ -528,3 +532,14 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension LocationRoomTimelineItemContent.AssetType {
|
||||
init(assetType: MatrixRustSDK.AssetType) {
|
||||
switch assetType {
|
||||
case .sender:
|
||||
self = .sender
|
||||
case .pin:
|
||||
self = .pin
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user