Adopt the new deduplicate room versions room list filter.
This commit is contained in:
committed by
Stefan Ceriu
parent
b4174aed22
commit
fadc3a1a1b
@@ -8712,7 +8712,7 @@
|
||||
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 25.05.27;
|
||||
version = 25.05.30;
|
||||
};
|
||||
};
|
||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||
|
||||
@@ -158,8 +158,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
||||
"state" : {
|
||||
"revision" : "8f9251bb7512d217ab8c1734e11725b514dcb8eb",
|
||||
"version" : "25.5.27"
|
||||
"revision" : "f5a5d25c26d5fba45490a0ab01b680594762d027",
|
||||
"version" : "25.5.30"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ extension RoomInfo {
|
||||
isDirect: false,
|
||||
isPublic: false,
|
||||
isSpace: false,
|
||||
tombstone: nil,
|
||||
successorRoom: nil,
|
||||
isFavourite: false,
|
||||
canonicalAlias: nil,
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
open var suggestedRoleForUserUserIdThrowableError: Error?
|
||||
|
||||
@@ -42,7 +42,7 @@ extension RoomInfo {
|
||||
isDirect: false,
|
||||
isPublic: false,
|
||||
isSpace: false,
|
||||
tombstone: nil,
|
||||
successorRoom: nil,
|
||||
isFavourite: false,
|
||||
canonicalAlias: nil,
|
||||
alternativeAliases: [],
|
||||
|
||||
@@ -152,7 +152,7 @@ extension RoomInfo {
|
||||
isDirect: configuration.isDirect,
|
||||
isPublic: configuration.isPublic,
|
||||
isSpace: configuration.isSpace,
|
||||
tombstone: nil,
|
||||
successorRoom: nil,
|
||||
isFavourite: false,
|
||||
canonicalAlias: configuration.canonicalAlias,
|
||||
alternativeAliases: configuration.alternativeAliases,
|
||||
|
||||
@@ -38,7 +38,7 @@ extension RoomInfo {
|
||||
isDirect: false,
|
||||
isPublic: false,
|
||||
isSpace: false,
|
||||
tombstone: nil,
|
||||
successorRoom: nil,
|
||||
isFavourite: false,
|
||||
canonicalAlias: nil,
|
||||
alternativeAliases: [],
|
||||
|
||||
@@ -61,7 +61,7 @@ struct RoomInfoProxy: BaseRoomInfoProxyProtocol {
|
||||
}
|
||||
|
||||
var isSpace: Bool { roomInfo.isSpace }
|
||||
var tombstoneInfo: RoomTombstoneInfo? { roomInfo.tombstone }
|
||||
var tombstoneInfo: SuccessorRoom? { roomInfo.successorRoom }
|
||||
var isFavourite: Bool { roomInfo.isFavourite }
|
||||
var canonicalAlias: String? { roomInfo.canonicalAlias }
|
||||
var alternativeAliases: [String] { roomInfo.alternativeAliases }
|
||||
|
||||
@@ -121,14 +121,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .none)
|
||||
case let .search(query):
|
||||
let filters: [RoomListEntriesDynamicFilterKind] = if appSettings.fuzzyRoomListSearchEnabled {
|
||||
[.fuzzyMatchRoomName(pattern: query), .nonLeft]
|
||||
[.fuzzyMatchRoomName(pattern: query), .nonLeft, .deduplicateVersions]
|
||||
} else {
|
||||
[.normalizedMatchRoomName(pattern: query), .nonLeft]
|
||||
[.normalizedMatchRoomName(pattern: query), .nonLeft, .deduplicateVersions]
|
||||
}
|
||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
||||
case let .all(filters):
|
||||
var filters = filters.map(\.rustFilter)
|
||||
filters.append(.nonLeft)
|
||||
filters.append(contentsOf: [.nonLeft, .deduplicateVersions])
|
||||
_ = listUpdatesSubscriptionResult?.controller().setFilter(kind: .all(filters: filters))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-argument-parser",
|
||||
"state" : {
|
||||
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
|
||||
"version" : "1.5.0"
|
||||
"revision" : "011f0c765fb46d9cac61bca19be0527e99c98c8b",
|
||||
"version" : "1.5.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ packages:
|
||||
# Element/Matrix dependencies
|
||||
MatrixRustSDK:
|
||||
url: https://github.com/element-hq/matrix-rust-components-swift
|
||||
exactVersion: 25.05.27
|
||||
exactVersion: 25.05.30
|
||||
# path: ../matrix-rust-sdk
|
||||
Compound:
|
||||
url: https://github.com/element-hq/compound-ios
|
||||
|
||||
Reference in New Issue
Block a user