mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Make room proxy unsubscriptions explicit. Fixes problems in which creating and deallocating room proxies would unexpectedly unsubscribe other proxies.
This commit is contained in:
@@ -51,10 +51,6 @@ class RoomProxy: RoomProxyProtocol {
|
||||
room.ownUserId()
|
||||
}
|
||||
|
||||
deinit {
|
||||
roomListItem.unsubscribe()
|
||||
}
|
||||
|
||||
init(roomListItem: RoomListItemProtocol,
|
||||
room: RoomProtocol,
|
||||
backgroundTaskService: BackgroundTaskServiceProtocol) async {
|
||||
@@ -89,6 +85,10 @@ class RoomProxy: RoomProxyProtocol {
|
||||
|
||||
subscribeToRoomStateUpdates()
|
||||
}
|
||||
|
||||
func unsubscribeFromUpdates() {
|
||||
roomListItem.unsubscribe()
|
||||
}
|
||||
|
||||
lazy var id: String = room.id()
|
||||
|
||||
|
||||
@@ -69,6 +69,8 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func subscribeForUpdates() async
|
||||
|
||||
func unsubscribeFromUpdates()
|
||||
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func reportContent(_ eventID: String, reason: String?) async -> Result<Void, RoomProxyError>
|
||||
|
||||
Reference in New Issue
Block a user