Skip to content

Commit

Permalink
Add pollHistory timeline property
Browse files Browse the repository at this point in the history
  • Loading branch information
alfogrillo committed Nov 28, 2023
1 parent 51ddc74 commit c98b097
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ElementX/Sources/Mocks/Generated/GeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,11 @@ class RoomProxyMock: RoomProxyProtocol {
set(value) { underlyingTimeline = value }
}
var underlyingTimeline: TimelineProxyProtocol!
var pollHistoryTimeline: TimelineProxyProtocol {
get { return underlyingPollHistoryTimeline }
set(value) { underlyingPollHistoryTimeline = value }
}
var underlyingPollHistoryTimeline: TimelineProxyProtocol!

//MARK: - subscribeForUpdates

Expand Down
2 changes: 2 additions & 0 deletions ElementX/Sources/Services/Room/RoomProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RoomProxy: RoomProxyProtocol {
private let roomListItem: RoomListItemProtocol
private let room: RoomProtocol
let timeline: TimelineProxyProtocol
let pollHistoryTimeline: TimelineProxyProtocol
private let backgroundTaskService: BackgroundTaskServiceProtocol
private let backgroundTaskName = "SendRoomEvent"

Expand Down Expand Up @@ -60,6 +61,7 @@ class RoomProxy: RoomProxyProtocol {
self.room = room
self.backgroundTaskService = backgroundTaskService
timeline = await TimelineProxy(timeline: room.timeline(), backgroundTaskService: backgroundTaskService)
pollHistoryTimeline = await TimelineProxy(timeline: room.pollHistory(), backgroundTaskService: backgroundTaskService)

Task {
// Force the timeline to load member details so it can populate sender profiles whenever we add a timeline listener
Expand Down
3 changes: 3 additions & 0 deletions ElementX/Sources/Services/Room/RoomProxyProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ protocol RoomProxyProtocol {

var timeline: TimelineProxyProtocol { get }

/// A timeline providing just polls related events
var pollHistoryTimeline: TimelineProxyProtocol { get }

func subscribeForUpdates() async

func loadAvatarURLForUserId(_ userId: String) async -> Result<URL?, RoomProxyError>
Expand Down

0 comments on commit c98b097

Please sign in to comment.