diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 140b702cf..caa252091 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -3962,7 +3962,7 @@ repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = "1.0.32-alpha"; + version = "1.0.33-alpha"; }; }; 96495DD8554E2F39D3954354 /* XCRemoteSwiftPackageReference "posthog-ios" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b14bec7f2..d371686e3 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-rust-components-swift", "state" : { - "revision" : "a119a8f16bbe3adc34cfdf2e092886d44e01705a", - "version" : "1.0.32-alpha" + "revision" : "2d702d0d52805e4f81924507b39ad81c8a74a63f", + "version" : "1.0.33-alpha" } }, { diff --git a/ElementX/Sources/Services/Room/MockRoomProxy.swift b/ElementX/Sources/Services/Room/MockRoomProxy.swift index 69bede4fd..83ff54638 100644 --- a/ElementX/Sources/Services/Room/MockRoomProxy.swift +++ b/ElementX/Sources/Services/Room/MockRoomProxy.swift @@ -29,6 +29,8 @@ struct MockRoomProxy: RoomProxyProtocol { var isPublic = Bool.random() var isEncrypted = Bool.random() var isTombstoned = Bool.random() + var canonicalAlias: String? + var alternativeAliases: [String] = [] var hasUnreadNotifications = Bool.random() var members: [RoomMemberProxy]? diff --git a/ElementX/Sources/Services/Room/RoomProxy.swift b/ElementX/Sources/Services/Room/RoomProxy.swift index 1a7596c80..89f96a968 100644 --- a/ElementX/Sources/Services/Room/RoomProxy.swift +++ b/ElementX/Sources/Services/Room/RoomProxy.swift @@ -83,6 +83,14 @@ class RoomProxy: RoomProxyProtocol { room.isTombstoned() } + var canonicalAlias: String? { + room.canonicalAlias() + } + + var alternativeAliases: [String] { + room.alternativeAliases() + } + var hasUnreadNotifications: Bool { slidingSyncRoom.hasUnreadNotifications() } diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index 69ecbcf9b..35ed44982 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -40,6 +40,8 @@ protocol RoomProxyProtocol { var isSpace: Bool { get } var isEncrypted: Bool { get } var isTombstoned: Bool { get } + var canonicalAlias: String? { get } + var alternativeAliases: [String] { get } var hasUnreadNotifications: Bool { get } var name: String? { get } diff --git a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift index 4c3499b8a..ae6e8a7b6 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift @@ -261,14 +261,11 @@ class RoomTimelineController: RoomTimelineControllerProtocol { } case .virtual(let virtualItem): switch virtualItem { - case .dayDivider(let year, let month, let day): + case .dayDivider(let timestamp): // These components will be replaced by a timestamp in upcoming releases - let dateComponents = DateComponents(calendar: .current, year: Int(year), month: Int(month), day: Int(day)) - if let dateString = dateComponents.date?.formatted(date: .complete, time: .omitted) { - newTimelineItems.append(SeparatorRoomTimelineItem(text: dateString)) - } else { - MXLog.error("Failed formatting separator date") - } + let date = Date(timeIntervalSince1970: TimeInterval(timestamp / 1000)) + let dateString = date.formatted(date: .complete, time: .omitted) + newTimelineItems.append(SeparatorRoomTimelineItem(text: dateString)) case .readMarker: // Don't show the read marker if it's the last item in the timeline if index != timelineProvider.itemsPublisher.value.indices.last { diff --git a/changelog.d/pr-486.change b/changelog.d/pr-486.change new file mode 100644 index 000000000..802c2d2c1 --- /dev/null +++ b/changelog.d/pr-486.change @@ -0,0 +1 @@ +Add support for aliases to RoomProxy and bump the SDK version. \ No newline at end of file diff --git a/project.yml b/project.yml index cd13cf02d..d604e80c8 100644 --- a/project.yml +++ b/project.yml @@ -40,7 +40,7 @@ include: packages: MatrixRustSDK: url: https://github.com/matrix-org/matrix-rust-components-swift - exactVersion: 1.0.32-alpha + exactVersion: 1.0.33-alpha # path: ../matrix-rust-sdk DesignKit: path: DesignKit