mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Adopt the new deduplicate room versions room list filter.
This commit is contained in:
committed by
Stefan Ceriu
parent
458c6aaa57
commit
1f52546fc8
@@ -8712,7 +8712,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 25.05.27;
|
version = 25.05.30;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
|
|||||||
@@ -158,8 +158,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "8f9251bb7512d217ab8c1734e11725b514dcb8eb",
|
"revision" : "f5a5d25c26d5fba45490a0ab01b680594762d027",
|
||||||
"version" : "25.5.27"
|
"version" : "25.5.30"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ extension RoomInfo {
|
|||||||
isDirect: false,
|
isDirect: false,
|
||||||
isPublic: false,
|
isPublic: false,
|
||||||
isSpace: false,
|
isSpace: false,
|
||||||
tombstone: nil,
|
successorRoom: nil,
|
||||||
isFavourite: false,
|
isFavourite: false,
|
||||||
canonicalAlias: nil,
|
canonicalAlias: nil,
|
||||||
alternativeAliases: [],
|
alternativeAliases: [],
|
||||||
|
|||||||
@@ -13749,71 +13749,6 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MARK: - isTombstoned
|
|
||||||
|
|
||||||
var isTombstonedUnderlyingCallsCount = 0
|
|
||||||
open var isTombstonedCallsCount: Int {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return isTombstonedUnderlyingCallsCount
|
|
||||||
} else {
|
|
||||||
var returnValue: Int? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = isTombstonedUnderlyingCallsCount
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
isTombstonedUnderlyingCallsCount = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
isTombstonedUnderlyingCallsCount = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var isTombstonedCalled: Bool {
|
|
||||||
return isTombstonedCallsCount > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
var isTombstonedUnderlyingReturnValue: Bool!
|
|
||||||
open var isTombstonedReturnValue: Bool! {
|
|
||||||
get {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
return isTombstonedUnderlyingReturnValue
|
|
||||||
} else {
|
|
||||||
var returnValue: Bool? = nil
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
returnValue = isTombstonedUnderlyingReturnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
return returnValue!
|
|
||||||
}
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
if Thread.isMainThread {
|
|
||||||
isTombstonedUnderlyingReturnValue = newValue
|
|
||||||
} else {
|
|
||||||
DispatchQueue.main.sync {
|
|
||||||
isTombstonedUnderlyingReturnValue = newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
open var isTombstonedClosure: (() -> Bool)?
|
|
||||||
|
|
||||||
open override func isTombstoned() -> Bool {
|
|
||||||
isTombstonedCallsCount += 1
|
|
||||||
if let isTombstonedClosure = isTombstonedClosure {
|
|
||||||
return isTombstonedClosure()
|
|
||||||
} else {
|
|
||||||
return isTombstonedReturnValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//MARK: - join
|
//MARK: - join
|
||||||
|
|
||||||
open var joinThrowableError: Error?
|
open var joinThrowableError: Error?
|
||||||
@@ -14966,6 +14901,71 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - predecessorRoom
|
||||||
|
|
||||||
|
var predecessorRoomUnderlyingCallsCount = 0
|
||||||
|
open var predecessorRoomCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return predecessorRoomUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = predecessorRoomUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
predecessorRoomUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
predecessorRoomUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var predecessorRoomCalled: Bool {
|
||||||
|
return predecessorRoomCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var predecessorRoomUnderlyingReturnValue: PredecessorRoom?
|
||||||
|
open var predecessorRoomReturnValue: PredecessorRoom? {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return predecessorRoomUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: PredecessorRoom?? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = predecessorRoomUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
predecessorRoomUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
predecessorRoomUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var predecessorRoomClosure: (() -> PredecessorRoom?)?
|
||||||
|
|
||||||
|
open override func predecessorRoom() -> PredecessorRoom? {
|
||||||
|
predecessorRoomCallsCount += 1
|
||||||
|
if let predecessorRoomClosure = predecessorRoomClosure {
|
||||||
|
return predecessorRoomClosure()
|
||||||
|
} else {
|
||||||
|
return predecessorRoomReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - previewRoom
|
//MARK: - previewRoom
|
||||||
|
|
||||||
open var previewRoomViaThrowableError: Error?
|
open var previewRoomViaThrowableError: Error?
|
||||||
@@ -16544,6 +16544,71 @@ open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//MARK: - successorRoom
|
||||||
|
|
||||||
|
var successorRoomUnderlyingCallsCount = 0
|
||||||
|
open var successorRoomCallsCount: Int {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return successorRoomUnderlyingCallsCount
|
||||||
|
} else {
|
||||||
|
var returnValue: Int? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = successorRoomUnderlyingCallsCount
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
successorRoomUnderlyingCallsCount = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
successorRoomUnderlyingCallsCount = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var successorRoomCalled: Bool {
|
||||||
|
return successorRoomCallsCount > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var successorRoomUnderlyingReturnValue: SuccessorRoom?
|
||||||
|
open var successorRoomReturnValue: SuccessorRoom? {
|
||||||
|
get {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
return successorRoomUnderlyingReturnValue
|
||||||
|
} else {
|
||||||
|
var returnValue: SuccessorRoom?? = nil
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
returnValue = successorRoomUnderlyingReturnValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if Thread.isMainThread {
|
||||||
|
successorRoomUnderlyingReturnValue = newValue
|
||||||
|
} else {
|
||||||
|
DispatchQueue.main.sync {
|
||||||
|
successorRoomUnderlyingReturnValue = newValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
open var successorRoomClosure: (() -> SuccessorRoom?)?
|
||||||
|
|
||||||
|
open override func successorRoom() -> SuccessorRoom? {
|
||||||
|
successorRoomCallsCount += 1
|
||||||
|
if let successorRoomClosure = successorRoomClosure {
|
||||||
|
return successorRoomClosure()
|
||||||
|
} else {
|
||||||
|
return successorRoomReturnValue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//MARK: - suggestedRoleForUser
|
//MARK: - suggestedRoleForUser
|
||||||
|
|
||||||
open var suggestedRoleForUserUserIdThrowableError: Error?
|
open var suggestedRoleForUserUserIdThrowableError: Error?
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ extension RoomInfo {
|
|||||||
isDirect: false,
|
isDirect: false,
|
||||||
isPublic: false,
|
isPublic: false,
|
||||||
isSpace: false,
|
isSpace: false,
|
||||||
tombstone: nil,
|
successorRoom: nil,
|
||||||
isFavourite: false,
|
isFavourite: false,
|
||||||
canonicalAlias: nil,
|
canonicalAlias: nil,
|
||||||
alternativeAliases: [],
|
alternativeAliases: [],
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ extension RoomInfo {
|
|||||||
isDirect: configuration.isDirect,
|
isDirect: configuration.isDirect,
|
||||||
isPublic: configuration.isPublic,
|
isPublic: configuration.isPublic,
|
||||||
isSpace: configuration.isSpace,
|
isSpace: configuration.isSpace,
|
||||||
tombstone: nil,
|
successorRoom: nil,
|
||||||
isFavourite: false,
|
isFavourite: false,
|
||||||
canonicalAlias: configuration.canonicalAlias,
|
canonicalAlias: configuration.canonicalAlias,
|
||||||
alternativeAliases: configuration.alternativeAliases,
|
alternativeAliases: configuration.alternativeAliases,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ extension RoomInfo {
|
|||||||
isDirect: false,
|
isDirect: false,
|
||||||
isPublic: false,
|
isPublic: false,
|
||||||
isSpace: false,
|
isSpace: false,
|
||||||
tombstone: nil,
|
successorRoom: nil,
|
||||||
isFavourite: false,
|
isFavourite: false,
|
||||||
canonicalAlias: nil,
|
canonicalAlias: nil,
|
||||||
alternativeAliases: [],
|
alternativeAliases: [],
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var isSpace: Bool { roomInfo.isSpace }
|
var isSpace: Bool { roomInfo.isSpace }
|
||||||
var tombstoneInfo: RoomTombstoneInfo? { roomInfo.tombstone }
|
var tombstoneInfo: SuccessorRoom? { roomInfo.successorRoom }
|
||||||
var isFavourite: Bool { roomInfo.isFavourite }
|
var isFavourite: Bool { roomInfo.isFavourite }
|
||||||
var canonicalAlias: String? { roomInfo.canonicalAlias }
|
var canonicalAlias: String? { roomInfo.canonicalAlias }
|
||||||
var alternativeAliases: [String] { roomInfo.alternativeAliases }
|
var alternativeAliases: [String] { roomInfo.alternativeAliases }
|
||||||
|
|||||||
@@ -121,14 +121,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
|||||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .none)
|
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .none)
|
||||||
case let .search(query):
|
case let .search(query):
|
||||||
let filters: [RoomListEntriesDynamicFilterKind] = if appSettings.fuzzyRoomListSearchEnabled {
|
let filters: [RoomListEntriesDynamicFilterKind] = if appSettings.fuzzyRoomListSearchEnabled {
|
||||||
[.fuzzyMatchRoomName(pattern: query), .nonLeft]
|
[.fuzzyMatchRoomName(pattern: query), .nonLeft, .deduplicateVersions]
|
||||||
} else {
|
} else {
|
||||||
[.normalizedMatchRoomName(pattern: query), .nonLeft]
|
[.normalizedMatchRoomName(pattern: query), .nonLeft, .deduplicateVersions]
|
||||||
}
|
}
|
||||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
||||||
case let .all(filters):
|
case let .all(filters):
|
||||||
var filters = filters.map(\.rustFilter)
|
var filters = filters.map(\.rustFilter)
|
||||||
filters.append(.nonLeft)
|
filters.append(contentsOf: [.nonLeft, .deduplicateVersions])
|
||||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/apple/swift-argument-parser",
|
"location" : "https://github.com/apple/swift-argument-parser",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
|
"revision" : "011f0c765fb46d9cac61bca19be0527e99c98c8b",
|
||||||
"version" : "1.5.0"
|
"version" : "1.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ packages:
|
|||||||
# Element/Matrix dependencies
|
# Element/Matrix dependencies
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/element-hq/matrix-rust-components-swift
|
url: https://github.com/element-hq/matrix-rust-components-swift
|
||||||
exactVersion: 25.05.27
|
exactVersion: 25.05.30
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
url: https://github.com/element-hq/compound-ios
|
||||||
|
|||||||
Reference in New Issue
Block a user