mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix strong reference cycle between RoomProxy and RoomTimelineProvider
This commit is contained in:
committed by
Stefan Ceriu
parent
40d80e1b90
commit
e2af796d4a
@@ -35,11 +35,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
private(set) var displayName: String?
|
||||
|
||||
private var backPaginationOutcome: PaginationOutcome?
|
||||
private(set) lazy var timelineProvider: RoomTimelineProviderProtocol = {
|
||||
let provider = RoomTimelineProvider(roomProxy: self)
|
||||
addTimelineListener(listener: WeakRoomTimelineProviderWrapper(timelineProvider: provider))
|
||||
return provider
|
||||
}()
|
||||
|
||||
deinit {
|
||||
room.removeTimeline()
|
||||
@@ -146,7 +141,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
private func addTimelineListener(listener: TimelineListener) {
|
||||
func addTimelineListener(listener: TimelineListener) {
|
||||
room.addTimelineListener(listener: listener)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,8 +44,6 @@ protocol RoomProxyProtocol {
|
||||
|
||||
var avatarURL: String? { get }
|
||||
|
||||
var timelineProvider: RoomTimelineProviderProtocol { get }
|
||||
|
||||
func avatarURLStringForUserId(_ userId: String) -> String?
|
||||
|
||||
func loadAvatarURLForUserId(_ userId: String) async -> Result<String?, RoomProxyError>
|
||||
@@ -56,6 +54,8 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func loadDisplayName() async -> Result<String, RoomProxyError>
|
||||
|
||||
func addTimelineListener(listener: TimelineListener)
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func sendMessage(_ message: String, inReplyToEventId: String?) async -> Result<Void, RoomProxyError>
|
||||
|
||||
Reference in New Issue
Block a user