mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Pinned Events Timeline actions and differentiation (#3182)
This commit is contained in:
@@ -44,7 +44,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
|
||||
do {
|
||||
let timeline = try await TimelineProxy(timeline: room.pinnedEventsTimeline(internalIdPrefix: nil, maxEventsToLoad: 100), isLive: false)
|
||||
let timeline = try await TimelineProxy(timeline: room.pinnedEventsTimeline(internalIdPrefix: nil, maxEventsToLoad: 100), isLive: true)
|
||||
await timeline.subscribeForUpdates()
|
||||
innerPinnedEventsTimeline = timeline
|
||||
return timeline
|
||||
|
||||
@@ -24,6 +24,10 @@ struct GeoURI: Hashable {
|
||||
let latitude: Double
|
||||
let longitude: Double
|
||||
let uncertainty: Double?
|
||||
|
||||
var bodyMessage: String {
|
||||
"Location was shared at \(string)"
|
||||
}
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
private let timelineItemFactory: RoomTimelineItemFactoryProtocol
|
||||
private let appSettings: AppSettings
|
||||
private let serialDispatchQueue: DispatchQueue
|
||||
private let shouldHideStart: Bool
|
||||
|
||||
let callbacks = PassthroughSubject<RoomTimelineControllerCallback, Never>()
|
||||
|
||||
@@ -44,12 +45,14 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
init(roomProxy: JoinedRoomProxyProtocol,
|
||||
timelineProxy: TimelineProxyProtocol,
|
||||
initialFocussedEventID: String?,
|
||||
shouldHideStart: Bool,
|
||||
timelineItemFactory: RoomTimelineItemFactoryProtocol,
|
||||
appSettings: AppSettings) {
|
||||
self.roomProxy = roomProxy
|
||||
liveTimelineProvider = timelineProxy.timelineProvider
|
||||
self.timelineItemFactory = timelineItemFactory
|
||||
self.appSettings = appSettings
|
||||
self.shouldHideStart = shouldHideStart
|
||||
serialDispatchQueue = DispatchQueue(label: "io.element.elementx.roomtimelineprovider", qos: .utility)
|
||||
|
||||
activeTimeline = timelineProxy
|
||||
@@ -364,7 +367,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
// Check if we need to add anything to the top of the timeline.
|
||||
switch paginationState.backward {
|
||||
case .timelineEndReached:
|
||||
if !roomProxy.isEncryptedOneToOneRoom {
|
||||
if !shouldHideStart, !roomProxy.isEncryptedOneToOneRoom {
|
||||
let timelineStart = TimelineStartRoomTimelineItem(name: roomProxy.name)
|
||||
newTimelineItems.insert(timelineStart, at: 0)
|
||||
}
|
||||
|
||||
+2
@@ -23,6 +23,7 @@ struct RoomTimelineControllerFactory: RoomTimelineControllerFactoryProtocol {
|
||||
RoomTimelineController(roomProxy: roomProxy,
|
||||
timelineProxy: roomProxy.timeline,
|
||||
initialFocussedEventID: initialFocussedEventID,
|
||||
shouldHideStart: false,
|
||||
timelineItemFactory: timelineItemFactory,
|
||||
appSettings: ServiceLocator.shared.settings)
|
||||
}
|
||||
@@ -35,6 +36,7 @@ struct RoomTimelineControllerFactory: RoomTimelineControllerFactoryProtocol {
|
||||
return RoomTimelineController(roomProxy: roomProxy,
|
||||
timelineProxy: pinnedEventsTimeline,
|
||||
initialFocussedEventID: nil,
|
||||
shouldHideStart: true,
|
||||
timelineItemFactory: timelineItemFactory,
|
||||
appSettings: ServiceLocator.shared.settings)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user