mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fix SS update observer and implicitly session verification not being requested
This commit is contained in:
committed by
Stefan Ceriu
parent
d44ce9f44c
commit
f29c0a9811
@@ -19,7 +19,7 @@ import Foundation
|
|||||||
import MatrixRustSDK
|
import MatrixRustSDK
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
private class WeakClientProxyWrapper: ClientDelegate {
|
private class WeakClientProxyWrapper: ClientDelegate, SlidingSyncObserver {
|
||||||
private weak var clientProxy: ClientProxy?
|
private weak var clientProxy: ClientProxy?
|
||||||
|
|
||||||
init(clientProxy: ClientProxy) {
|
init(clientProxy: ClientProxy) {
|
||||||
@@ -39,6 +39,13 @@ private class WeakClientProxyWrapper: ClientDelegate {
|
|||||||
MXLog.info("Did update restoration token")
|
MXLog.info("Did update restoration token")
|
||||||
clientProxy?.didUpdateRestoreToken()
|
clientProxy?.didUpdateRestoreToken()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - SlidingSyncDelegate
|
||||||
|
|
||||||
|
func didReceiveSyncUpdate(summary: UpdateSummary) {
|
||||||
|
MXLog.info("Received sliding sync update")
|
||||||
|
clientProxy?.didReceiveSlidingSyncUpdate(summary: summary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ClientProxy: ClientProxyProtocol {
|
class ClientProxy: ClientProxyProtocol {
|
||||||
@@ -267,6 +274,8 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
.coldCache(name: "ElementX")
|
.coldCache(name: "ElementX")
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
slidingSync.setObserver(observer: WeakClientProxyWrapper(clientProxy: self))
|
||||||
|
|
||||||
self.slidingSync = slidingSync
|
self.slidingSync = slidingSync
|
||||||
|
|
||||||
buildAndConfigureVisibleRoomsSlidingSyncView(slidingSync: slidingSync, visibleRoomsView: visibleRoomsView)
|
buildAndConfigureVisibleRoomsSlidingSyncView(slidingSync: slidingSync, visibleRoomsView: visibleRoomsView)
|
||||||
@@ -370,6 +379,10 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
callbacks.send(.updatedRestoreToken)
|
callbacks.send(.updatedRestoreToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fileprivate func didReceiveSlidingSyncUpdate(summary: UpdateSummary) {
|
||||||
|
callbacks.send(.receivedSyncUpdate)
|
||||||
|
}
|
||||||
|
|
||||||
/// Convenience method to get the json string of an Encodable
|
/// Convenience method to get the json string of an Encodable
|
||||||
private func jsonString(from dictionary: [AnyHashable: Any]?) -> String? {
|
private func jsonString(from dictionary: [AnyHashable: Any]?) -> String? {
|
||||||
guard let dictionary,
|
guard let dictionary,
|
||||||
|
|||||||
Reference in New Issue
Block a user