Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State events filtering + Bump sdk #2404

Merged
merged 4 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand Down
24 changes: 22 additions & 2 deletions ElementX/Sources/Services/Client/ClientProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,34 @@ class ClientProxy: ClientProxyProtocol {
})
}

private let eventFilters: TimelineEventTypeFilter = .exclude(eventTypes: [
.state(eventType: .roomAliases),
.state(eventType: .roomCanonicalAlias),
.state(eventType: .roomGuestAccess),
.state(eventType: .roomHistoryVisibility),
.state(eventType: .roomJoinRules),
.state(eventType: .roomPinnedEvents),
.state(eventType: .roomPowerLevels),
.state(eventType: .roomServerAcl),
.state(eventType: .roomTombstone),
.state(eventType: .spaceChild),
.state(eventType: .spaceParent),
.state(eventType: .policyRuleRoom),
.state(eventType: .policyRuleServer),
.state(eventType: .policyRuleServer)
Velin92 marked this conversation as resolved.
Show resolved Hide resolved
])
Velin92 marked this conversation as resolved.
Show resolved Hide resolved

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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading