mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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 UIKit
|
||||
|
||||
private class WeakClientProxyWrapper: ClientDelegate {
|
||||
private class WeakClientProxyWrapper: ClientDelegate, SlidingSyncObserver {
|
||||
private weak var clientProxy: ClientProxy?
|
||||
|
||||
init(clientProxy: ClientProxy) {
|
||||
@@ -39,6 +39,13 @@ private class WeakClientProxyWrapper: ClientDelegate {
|
||||
MXLog.info("Did update restoration token")
|
||||
clientProxy?.didUpdateRestoreToken()
|
||||
}
|
||||
|
||||
// MARK: - SlidingSyncDelegate
|
||||
|
||||
func didReceiveSyncUpdate(summary: UpdateSummary) {
|
||||
MXLog.info("Received sliding sync update")
|
||||
clientProxy?.didReceiveSlidingSyncUpdate(summary: summary)
|
||||
}
|
||||
}
|
||||
|
||||
class ClientProxy: ClientProxyProtocol {
|
||||
@@ -267,6 +274,8 @@ class ClientProxy: ClientProxyProtocol {
|
||||
.coldCache(name: "ElementX")
|
||||
.build()
|
||||
|
||||
slidingSync.setObserver(observer: WeakClientProxyWrapper(clientProxy: self))
|
||||
|
||||
self.slidingSync = slidingSync
|
||||
|
||||
buildAndConfigureVisibleRoomsSlidingSyncView(slidingSync: slidingSync, visibleRoomsView: visibleRoomsView)
|
||||
@@ -370,6 +379,10 @@ class ClientProxy: ClientProxyProtocol {
|
||||
callbacks.send(.updatedRestoreToken)
|
||||
}
|
||||
|
||||
fileprivate func didReceiveSlidingSyncUpdate(summary: UpdateSummary) {
|
||||
callbacks.send(.receivedSyncUpdate)
|
||||
}
|
||||
|
||||
/// Convenience method to get the json string of an Encodable
|
||||
private func jsonString(from dictionary: [AnyHashable: Any]?) -> String? {
|
||||
guard let dictionary,
|
||||
|
||||
Reference in New Issue
Block a user