mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Adopt latest rust side sliding sync fixes. Relates to https://github.com/matrix-org/matrix-rust-sdk/pull/1936
This commit is contained in:
committed by
Stefan Ceriu
parent
0066761380
commit
ce36be4e8b
@@ -4609,7 +4609,7 @@
|
|||||||
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = "0.0.1-paginate-only-with-token";
|
version = "1.0.65-alpha";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
96495DD8554E2F39D3954354 /* XCRemoteSwiftPackageReference "posthog-ios" */ = {
|
96495DD8554E2F39D3954354 /* XCRemoteSwiftPackageReference "posthog-ios" */ = {
|
||||||
|
|||||||
@@ -102,8 +102,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
|
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "f7e5c77a9f443e93edb179d5cc1b0b1cb2f5e0b1",
|
"revision" : "937bd40d601b59d676c18e466fd111925e498799",
|
||||||
"version" : "0.0.1-paginate-only-with-token"
|
"version" : "1.0.65-alpha"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
{
|
{
|
||||||
"identity" : "swift-snapshot-testing",
|
"identity" : "swift-snapshot-testing",
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
|
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "cef5b3f6f11781dd4591bdd1dd0a3d22bd609334",
|
"revision" : "cef5b3f6f11781dd4591bdd1dd0a3d22bd609334",
|
||||||
"version" : "1.11.0"
|
"version" : "1.11.0"
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
private var slidingSyncObserverToken: TaskHandle?
|
private var slidingSyncObserverToken: TaskHandle?
|
||||||
private var slidingSync: SlidingSyncProtocol?
|
private var slidingSync: SlidingSyncProtocol?
|
||||||
|
private var slidingSyncTasks = [TaskHandle?]()
|
||||||
|
|
||||||
var visibleRoomsListBuilder: SlidingSyncListBuilder?
|
var visibleRoomsListBuilder: SlidingSyncListBuilder?
|
||||||
var visibleRoomsListProxy: SlidingSyncListProxy?
|
var visibleRoomsListProxy: SlidingSyncListProxy?
|
||||||
@@ -532,14 +533,14 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
if let allRoomsListBuilder {
|
if let allRoomsListBuilder {
|
||||||
MXLog.info("Registering all rooms view")
|
MXLog.info("Registering all rooms view")
|
||||||
_ = slidingSync?.addList(listBuilder: allRoomsListBuilder)
|
slidingSyncTasks.append(slidingSync?.addList(listBuilder: allRoomsListBuilder))
|
||||||
} else {
|
} else {
|
||||||
MXLog.error("All rooms sliding sync view unavailable")
|
MXLog.error("All rooms sliding sync view unavailable")
|
||||||
}
|
}
|
||||||
|
|
||||||
if let invitesListBuilder {
|
if let invitesListBuilder {
|
||||||
MXLog.info("Registering invites view")
|
MXLog.info("Registering invites view")
|
||||||
_ = slidingSync?.addList(listBuilder: invitesListBuilder)
|
slidingSyncTasks.append(slidingSync?.addList(listBuilder: invitesListBuilder))
|
||||||
} else {
|
} else {
|
||||||
MXLog.error("Invites sliding sync view unavailable")
|
MXLog.error("Invites sliding sync view unavailable")
|
||||||
}
|
}
|
||||||
@@ -547,7 +548,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
if ServiceLocator.shared.settings.enableLocalPushNotifications {
|
if ServiceLocator.shared.settings.enableLocalPushNotifications {
|
||||||
if let notificationsListBuilder {
|
if let notificationsListBuilder {
|
||||||
MXLog.info("Registering notifications view")
|
MXLog.info("Registering notifications view")
|
||||||
_ = slidingSync?.addList(listBuilder: notificationsListBuilder)
|
slidingSyncTasks.append(slidingSync?.addList(listBuilder: notificationsListBuilder))
|
||||||
} else {
|
} else {
|
||||||
MXLog.error("Notifications sliding sync view unavailable")
|
MXLog.error("Notifications sliding sync view unavailable")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,9 @@ class RoomProxy: RoomProxyProtocol {
|
|||||||
|
|
||||||
private(set) var displayName: String?
|
private(set) var displayName: String?
|
||||||
|
|
||||||
private var timelineObservationToken: TaskHandle?
|
private var roomSubscriptionObservationToken: TaskHandle?
|
||||||
|
private var roomUnsubscriptionObservationToken: TaskHandle?
|
||||||
|
private var roomTimelineObservationToken: TaskHandle?
|
||||||
|
|
||||||
private let membersSubject = CurrentValueSubject<[RoomMemberProxyProtocol], Never>([])
|
private let membersSubject = CurrentValueSubject<[RoomMemberProxyProtocol], Never>([])
|
||||||
var membersPublisher: AnyPublisher<[RoomMemberProxyProtocol], Never> {
|
var membersPublisher: AnyPublisher<[RoomMemberProxyProtocol], Never> {
|
||||||
@@ -142,8 +144,10 @@ class RoomProxy: RoomProxyProtocol {
|
|||||||
RequiredState(key: "m.room.canonical_alias", value: ""),
|
RequiredState(key: "m.room.canonical_alias", value: ""),
|
||||||
RequiredState(key: "m.room.join_rules", value: "")],
|
RequiredState(key: "m.room.join_rules", value: "")],
|
||||||
timelineLimit: UInt32(SlidingSyncConstants.timelinePrecachingTimelineLimit))
|
timelineLimit: UInt32(SlidingSyncConstants.timelinePrecachingTimelineLimit))
|
||||||
if let result = try? slidingSyncRoom.subscribeAndAddTimelineListener(listener: listener, settings: settings) {
|
roomSubscriptionObservationToken = slidingSyncRoom.subscribeToRoom(settings: settings)
|
||||||
timelineObservationToken = result.taskHandle
|
|
||||||
|
if let result = try? slidingSyncRoom.addTimelineListener(listener: listener) {
|
||||||
|
roomTimelineObservationToken = result.taskHandle
|
||||||
Task {
|
Task {
|
||||||
await fetchMembers()
|
await fetchMembers()
|
||||||
await updateMembers()
|
await updateMembers()
|
||||||
@@ -155,8 +159,12 @@ class RoomProxy: RoomProxyProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func removeTimelineListener() {
|
func removeTimelineListener() {
|
||||||
timelineObservationToken?.cancel()
|
roomTimelineObservationToken?.cancel()
|
||||||
timelineObservationToken = nil
|
roomTimelineObservationToken = nil
|
||||||
|
|
||||||
|
roomSubscriptionObservationToken = nil
|
||||||
|
|
||||||
|
roomUnsubscriptionObservationToken = slidingSyncRoom.unsubscribeFromRoom()
|
||||||
}
|
}
|
||||||
|
|
||||||
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomProxyError> {
|
func paginateBackwards(requestSize: UInt, untilNumberOfItems: UInt) async -> Result<Void, RoomProxyError> {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ struct EventTimelineItemProxy {
|
|||||||
guard let localSendState = item.localSendState() else { return nil }
|
guard let localSendState = item.localSendState() else { return nil }
|
||||||
|
|
||||||
switch localSendState {
|
switch localSendState {
|
||||||
case .notSendYet:
|
case .notSentYet:
|
||||||
return .sending
|
return .sending
|
||||||
case .sendingFailed:
|
case .sendingFailed:
|
||||||
return .sendingFailed
|
return .sendingFailed
|
||||||
|
|||||||
+1
-1
@@ -42,7 +42,7 @@ include:
|
|||||||
packages:
|
packages:
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/matrix-org/matrix-rust-components-swift
|
url: https://github.com/matrix-org/matrix-rust-components-swift
|
||||||
exactVersion: 0.0.1-paginate-only-with-token
|
exactVersion: 1.0.65-alpha
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
DesignKit:
|
DesignKit:
|
||||||
path: DesignKit
|
path: DesignKit
|
||||||
|
|||||||
Reference in New Issue
Block a user