State events filtering + Bump sdk (#2404)

This commit is contained in:
Mauro 2024-01-30 16:48:34 +01:00 committed by GitHub
parent b338e98ed4
commit a795e42961
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 6 deletions

View File

@ -6732,7 +6732,7 @@
repositoryURL = "https://github.com/matrix-org/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.1.35;
version = 1.1.36;
};
};
821C67C9A7F8CC3FD41B28B4 /* XCRemoteSwiftPackageReference "emojibase-bindings" */ = {

View File

@ -130,8 +130,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-rust-components-swift",
"state" : {
"revision" : "b7ed8b30a1b648ebdf87bb14a11f071df4999e03",
"version" : "1.1.35"
"revision" : "e6aecad747a12e399ee718b5fb2ece45b7b6e23a",
"version" : "1.1.36"
}
},
{

View File

@ -586,14 +586,35 @@ class ClientProxy: ClientProxyProtocol {
})
}
private let eventFilters: TimelineEventTypeFilter = {
let stateEventFilters: [FilterStateEventType] = [.roomAliases,
.roomCanonicalAlias,
.roomGuestAccess,
.roomHistoryVisibility,
.roomJoinRules,
.roomPinnedEvents,
.roomPowerLevels,
.roomServerAcl,
.roomTombstone,
.spaceChild,
.spaceParent,
.policyRuleRoom,
.policyRuleServer]
return .exclude(eventTypes: stateEventFilters.map { FilterTimelineEventType.state(eventType: $0) })
}()
private func roomTupleForIdentifier(_ identifier: String) async -> (RoomListItem?, Room?) {
do {
let roomListItem = try roomListService?.room(roomId: identifier)
let fullRoom = await roomListItem?.fullRoom()
if roomListItem?.isTimelineInitialized() == false {
try await roomListItem?.initTimeline(eventTypeFilter: eventFilters)
}
let fullRoom = try await roomListItem?.fullRoom()
return (roomListItem, fullRoom)
} catch {
MXLog.error("Failed retrieving room with identifier: \(identifier)")
MXLog.error("Failed retrieving/initialising room with identifier: \(identifier)")
return (nil, nil)
}
}

1
changelog.d/2404.change Normal file
View File

@ -0,0 +1 @@
The timeline will filter some unnecessary state events.

View File

@ -47,7 +47,7 @@ packages:
# Element/Matrix dependencies
MatrixRustSDK:
url: https://github.com/matrix-org/matrix-rust-components-swift
exactVersion: 1.1.35
exactVersion: 1.1.36
# path: ../matrix-rust-sdk
Compound:
url: https://github.com/element-hq/compound-ios