mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Bump the RustSDK to v25.03.05
- adopt the new timeline configuration which now exposes read receipts tracking. For now it should be set to `false` for all timelines except the live one, which still gets configured properly on the rust side through `init_timeline`. Eventually we will converge on this configuration API for all of them. - also adopt the new rust side cache clearing method and remove our own
This commit is contained in:
committed by
Stefan Ceriu
parent
fb8a1f33d8
commit
4d34a1ed56
@@ -702,6 +702,15 @@ class ClientProxy: ClientProxyProtocol {
|
||||
func getElementWellKnown() async -> Result<ElementWellKnown?, ClientProxyError> {
|
||||
await client.getElementWellKnown().map(ElementWellKnown.init)
|
||||
}
|
||||
|
||||
func clearCaches() async -> Result<Void, ClientProxyError> {
|
||||
do {
|
||||
return try await .success(client.clearCaches())
|
||||
} catch {
|
||||
MXLog.error("Failed clearing client caches with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Ignored users
|
||||
|
||||
|
||||
@@ -179,6 +179,8 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
|
||||
func isAliasAvailable(_ alias: String) async -> Result<Bool, ClientProxyError>
|
||||
|
||||
func getElementWellKnown() async -> Result<ElementWellKnown?, ClientProxyError>
|
||||
|
||||
@discardableResult func clearCaches() async -> Result<Void, ClientProxyError>
|
||||
|
||||
// MARK: - Ignored users
|
||||
|
||||
|
||||
@@ -36,9 +36,10 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
|
||||
do {
|
||||
let sdkTimeline = try await room.timelineWithConfiguration(configuration: .init(focus: .pinnedEvents(maxEventsToLoad: 100, maxConcurrentRequests: 10),
|
||||
allowedMessageTypes: .all,
|
||||
filter: .all,
|
||||
internalIdPrefix: nil,
|
||||
dateDividerMode: .daily))
|
||||
dateDividerMode: .daily,
|
||||
trackReadReceipts: false))
|
||||
|
||||
let timeline = TimelineProxy(timeline: sdkTimeline, kind: .pinned)
|
||||
|
||||
@@ -159,9 +160,10 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
func timelineFocusedOnEvent(eventID: String, numberOfEvents: UInt16) async -> Result<TimelineProxyProtocol, RoomProxyError> {
|
||||
do {
|
||||
let sdkTimeline = try await room.timelineWithConfiguration(configuration: .init(focus: .event(eventId: eventID, numContextEvents: numberOfEvents),
|
||||
allowedMessageTypes: .all,
|
||||
filter: .all,
|
||||
internalIdPrefix: UUID().uuidString,
|
||||
dateDividerMode: .daily))
|
||||
dateDividerMode: .daily,
|
||||
trackReadReceipts: false))
|
||||
|
||||
return .success(TimelineProxy(timeline: sdkTimeline, kind: .detached))
|
||||
} catch let error as FocusEventError {
|
||||
@@ -202,9 +204,10 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
}
|
||||
|
||||
let sdkTimeline = try await room.timelineWithConfiguration(configuration: .init(focus: rustFocus,
|
||||
allowedMessageTypes: .only(types: rustMessageTypes),
|
||||
filter: .onlyMessage(types: rustMessageTypes),
|
||||
internalIdPrefix: nil,
|
||||
dateDividerMode: .monthly))
|
||||
dateDividerMode: .monthly,
|
||||
trackReadReceipts: false))
|
||||
|
||||
let timeline = TimelineProxy(timeline: sdkTimeline, kind: .media(presentation))
|
||||
await timeline.subscribeForUpdates()
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
import Foundation
|
||||
|
||||
/// A preview object for the Room. useful to get all the possible info for rooms to which the user is not invited to
|
||||
// sourcery: AutoMockable
|
||||
protocol RoomPreviewProxyProtocol {
|
||||
var info: RoomPreviewInfoProxy { get }
|
||||
var ownMembershipDetails: RoomMembershipDetailsProxyProtocol? { get async }
|
||||
}
|
||||
|
||||
// sourcery: AutoMockable
|
||||
extension RoomPreviewProxyProtocol { }
|
||||
|
||||
@@ -91,15 +91,7 @@ class UserSessionStore: UserSessionStoreProtocol {
|
||||
credentials.restorationToken.sessionDirectories.delete()
|
||||
}
|
||||
}
|
||||
|
||||
func clearCache(for userID: String) {
|
||||
guard let credentials = keychainController.restorationTokens().first(where: { $0.userID == userID }) else {
|
||||
MXLog.error("Failed to clearing caches: Credentials missing")
|
||||
return
|
||||
}
|
||||
credentials.restorationToken.sessionDirectories.deleteTransientUserData()
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
private func buildUserSessionWithClient(_ clientProxy: ClientProxyProtocol) -> UserSessionProtocol {
|
||||
|
||||
@@ -36,7 +36,4 @@ protocol UserSessionStoreProtocol {
|
||||
|
||||
/// Logs out of the specified session.
|
||||
func logout(userSession: UserSessionProtocol)
|
||||
|
||||
/// Clears our all the matrix sdk state data for the specified session
|
||||
func clearCache(for userID: String)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user