mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:02:10 +00:00
Adopt the new search backfill client interfaces.
This commit is contained in:
@@ -56,6 +56,8 @@ class ClientProxy: ClientProxyProtocol {
|
||||
|
||||
private var delegateHandle: TaskHandle?
|
||||
|
||||
private var searchBackfillTaskHandle: TaskHandle?
|
||||
|
||||
// These following summary providers both operate on the same allRooms() list but
|
||||
// can apply their own filtering and pagination
|
||||
private(set) var roomSummaryProvider: RoomSummaryProviderProtocol
|
||||
@@ -473,6 +475,25 @@ class ClientProxy: ClientProxyProtocol {
|
||||
await transitionServices(to: .suspended).value
|
||||
}
|
||||
|
||||
func startSearchBackfill(strategy: SearchBackfillStrategy) {
|
||||
if strategy == .foreground, isSearchBackfillRunning {
|
||||
return
|
||||
}
|
||||
|
||||
MXLog.info("Starting search backfill with strategy: \(strategy)")
|
||||
searchBackfillTaskHandle?.cancel()
|
||||
searchBackfillTaskHandle = client.runSearchBackfill(strategy: strategy)
|
||||
}
|
||||
|
||||
func stopSearchBackfill() {
|
||||
searchBackfillTaskHandle?.cancel()
|
||||
searchBackfillTaskHandle = nil
|
||||
}
|
||||
|
||||
var isSearchBackfillRunning: Bool {
|
||||
searchBackfillTaskHandle?.isFinished() == false
|
||||
}
|
||||
|
||||
func expireSyncSessions() async {
|
||||
await syncService.expireSessions()
|
||||
}
|
||||
@@ -1188,6 +1209,8 @@ class ClientProxy: ClientProxyProtocol {
|
||||
case .suspended:
|
||||
updateHomeserverReachability()
|
||||
|
||||
stopSearchBackfill()
|
||||
|
||||
MXLog.info("Stopping sync")
|
||||
await syncService.stop()
|
||||
MXLog.info("Sync stopped")
|
||||
|
||||
@@ -187,6 +187,12 @@ protocol ClientProxyProtocol: AnyObject {
|
||||
|
||||
func pauseServices() async
|
||||
|
||||
func startSearchBackfill(strategy: SearchBackfillStrategy)
|
||||
|
||||
func stopSearchBackfill()
|
||||
|
||||
var isSearchBackfillRunning: Bool { get }
|
||||
|
||||
func expireSyncSessions() async
|
||||
|
||||
func accountURL(action: AccountManagementAction) async -> URL?
|
||||
|
||||
Reference in New Issue
Block a user