mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Security and privacy part 2 (#3637)
* handling the history visibility flag * better logic to handle visibility * better handling of the visibility options state * added some copies, and the public room directory visibility state * completed the UI added also the preview tests * improved the handling of the directory visibility * added the space users case and improved handling of the access -> vsibility reaction. Also added a simple error handling for the public directory toggle * added the edit room address view but is missing its full implementation * implement the UI for the edit room address screen * implemented error checking when editing the address * updated preview tests and improved code * typo fix * Fix various issues after rebasing. * Fix build errors and broken snapshot tests * Adopt latest room privacy and canonical alias setting APIs * Add support for creating and editing the room's alias. * Add support for saving room privacy setting changes. * Fix room alias screen snapshot tests following recent changes. --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -6223,6 +6223,70 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol {
|
||||
return messageFilteredTimelineAllowedMessageTypesReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - enableEncryption
|
||||
|
||||
var enableEncryptionUnderlyingCallsCount = 0
|
||||
var enableEncryptionCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return enableEncryptionUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = enableEncryptionUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
enableEncryptionUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
enableEncryptionUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var enableEncryptionCalled: Bool {
|
||||
return enableEncryptionCallsCount > 0
|
||||
}
|
||||
|
||||
var enableEncryptionUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var enableEncryptionReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return enableEncryptionUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = enableEncryptionUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
enableEncryptionUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
enableEncryptionUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var enableEncryptionClosure: (() async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func enableEncryption() async -> Result<Void, RoomProxyError> {
|
||||
enableEncryptionCallsCount += 1
|
||||
if let enableEncryptionClosure = enableEncryptionClosure {
|
||||
return await enableEncryptionClosure()
|
||||
} else {
|
||||
return enableEncryptionReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - redact
|
||||
|
||||
var redactUnderlyingCallsCount = 0
|
||||
@@ -7227,6 +7291,490 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol {
|
||||
return withdrawVerificationAndResendUserIDsSendHandleReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - updateJoinRule
|
||||
|
||||
var updateJoinRuleUnderlyingCallsCount = 0
|
||||
var updateJoinRuleCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateJoinRuleUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateJoinRuleUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateJoinRuleUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateJoinRuleUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateJoinRuleCalled: Bool {
|
||||
return updateJoinRuleCallsCount > 0
|
||||
}
|
||||
var updateJoinRuleReceivedRule: JoinRule?
|
||||
var updateJoinRuleReceivedInvocations: [JoinRule] = []
|
||||
|
||||
var updateJoinRuleUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var updateJoinRuleReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateJoinRuleUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateJoinRuleUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateJoinRuleUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateJoinRuleUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateJoinRuleClosure: ((JoinRule) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func updateJoinRule(_ rule: JoinRule) async -> Result<Void, RoomProxyError> {
|
||||
updateJoinRuleCallsCount += 1
|
||||
updateJoinRuleReceivedRule = rule
|
||||
DispatchQueue.main.async {
|
||||
self.updateJoinRuleReceivedInvocations.append(rule)
|
||||
}
|
||||
if let updateJoinRuleClosure = updateJoinRuleClosure {
|
||||
return await updateJoinRuleClosure(rule)
|
||||
} else {
|
||||
return updateJoinRuleReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - updateHistoryVisibility
|
||||
|
||||
var updateHistoryVisibilityUnderlyingCallsCount = 0
|
||||
var updateHistoryVisibilityCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateHistoryVisibilityUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateHistoryVisibilityUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateHistoryVisibilityUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateHistoryVisibilityUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateHistoryVisibilityCalled: Bool {
|
||||
return updateHistoryVisibilityCallsCount > 0
|
||||
}
|
||||
var updateHistoryVisibilityReceivedVisibility: RoomHistoryVisibility?
|
||||
var updateHistoryVisibilityReceivedInvocations: [RoomHistoryVisibility] = []
|
||||
|
||||
var updateHistoryVisibilityUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var updateHistoryVisibilityReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateHistoryVisibilityUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateHistoryVisibilityUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateHistoryVisibilityUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateHistoryVisibilityUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateHistoryVisibilityClosure: ((RoomHistoryVisibility) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func updateHistoryVisibility(_ visibility: RoomHistoryVisibility) async -> Result<Void, RoomProxyError> {
|
||||
updateHistoryVisibilityCallsCount += 1
|
||||
updateHistoryVisibilityReceivedVisibility = visibility
|
||||
DispatchQueue.main.async {
|
||||
self.updateHistoryVisibilityReceivedInvocations.append(visibility)
|
||||
}
|
||||
if let updateHistoryVisibilityClosure = updateHistoryVisibilityClosure {
|
||||
return await updateHistoryVisibilityClosure(visibility)
|
||||
} else {
|
||||
return updateHistoryVisibilityReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - isVisibleInRoomDirectory
|
||||
|
||||
var isVisibleInRoomDirectoryUnderlyingCallsCount = 0
|
||||
var isVisibleInRoomDirectoryCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return isVisibleInRoomDirectoryUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = isVisibleInRoomDirectoryUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
isVisibleInRoomDirectoryUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
isVisibleInRoomDirectoryUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var isVisibleInRoomDirectoryCalled: Bool {
|
||||
return isVisibleInRoomDirectoryCallsCount > 0
|
||||
}
|
||||
|
||||
var isVisibleInRoomDirectoryUnderlyingReturnValue: Result<Bool, RoomProxyError>!
|
||||
var isVisibleInRoomDirectoryReturnValue: Result<Bool, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return isVisibleInRoomDirectoryUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Bool, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = isVisibleInRoomDirectoryUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
isVisibleInRoomDirectoryUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
isVisibleInRoomDirectoryUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var isVisibleInRoomDirectoryClosure: (() async -> Result<Bool, RoomProxyError>)?
|
||||
|
||||
func isVisibleInRoomDirectory() async -> Result<Bool, RoomProxyError> {
|
||||
isVisibleInRoomDirectoryCallsCount += 1
|
||||
if let isVisibleInRoomDirectoryClosure = isVisibleInRoomDirectoryClosure {
|
||||
return await isVisibleInRoomDirectoryClosure()
|
||||
} else {
|
||||
return isVisibleInRoomDirectoryReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - updateRoomDirectoryVisibility
|
||||
|
||||
var updateRoomDirectoryVisibilityUnderlyingCallsCount = 0
|
||||
var updateRoomDirectoryVisibilityCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateRoomDirectoryVisibilityUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateRoomDirectoryVisibilityUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateRoomDirectoryVisibilityUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateRoomDirectoryVisibilityUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateRoomDirectoryVisibilityCalled: Bool {
|
||||
return updateRoomDirectoryVisibilityCallsCount > 0
|
||||
}
|
||||
var updateRoomDirectoryVisibilityReceivedVisibility: RoomVisibility?
|
||||
var updateRoomDirectoryVisibilityReceivedInvocations: [RoomVisibility] = []
|
||||
|
||||
var updateRoomDirectoryVisibilityUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var updateRoomDirectoryVisibilityReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateRoomDirectoryVisibilityUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateRoomDirectoryVisibilityUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateRoomDirectoryVisibilityUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateRoomDirectoryVisibilityUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateRoomDirectoryVisibilityClosure: ((RoomVisibility) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func updateRoomDirectoryVisibility(_ visibility: RoomVisibility) async -> Result<Void, RoomProxyError> {
|
||||
updateRoomDirectoryVisibilityCallsCount += 1
|
||||
updateRoomDirectoryVisibilityReceivedVisibility = visibility
|
||||
DispatchQueue.main.async {
|
||||
self.updateRoomDirectoryVisibilityReceivedInvocations.append(visibility)
|
||||
}
|
||||
if let updateRoomDirectoryVisibilityClosure = updateRoomDirectoryVisibilityClosure {
|
||||
return await updateRoomDirectoryVisibilityClosure(visibility)
|
||||
} else {
|
||||
return updateRoomDirectoryVisibilityReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - updateCanonicalAlias
|
||||
|
||||
var updateCanonicalAliasAltAliasesUnderlyingCallsCount = 0
|
||||
var updateCanonicalAliasAltAliasesCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateCanonicalAliasAltAliasesUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateCanonicalAliasAltAliasesUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateCanonicalAliasAltAliasesUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateCanonicalAliasAltAliasesUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateCanonicalAliasAltAliasesCalled: Bool {
|
||||
return updateCanonicalAliasAltAliasesCallsCount > 0
|
||||
}
|
||||
var updateCanonicalAliasAltAliasesReceivedArguments: (alias: String?, altAliases: [String])?
|
||||
var updateCanonicalAliasAltAliasesReceivedInvocations: [(alias: String?, altAliases: [String])] = []
|
||||
|
||||
var updateCanonicalAliasAltAliasesUnderlyingReturnValue: Result<Void, RoomProxyError>!
|
||||
var updateCanonicalAliasAltAliasesReturnValue: Result<Void, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateCanonicalAliasAltAliasesUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Void, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateCanonicalAliasAltAliasesUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateCanonicalAliasAltAliasesUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateCanonicalAliasAltAliasesUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var updateCanonicalAliasAltAliasesClosure: ((String?, [String]) async -> Result<Void, RoomProxyError>)?
|
||||
|
||||
func updateCanonicalAlias(_ alias: String?, altAliases: [String]) async -> Result<Void, RoomProxyError> {
|
||||
updateCanonicalAliasAltAliasesCallsCount += 1
|
||||
updateCanonicalAliasAltAliasesReceivedArguments = (alias: alias, altAliases: altAliases)
|
||||
DispatchQueue.main.async {
|
||||
self.updateCanonicalAliasAltAliasesReceivedInvocations.append((alias: alias, altAliases: altAliases))
|
||||
}
|
||||
if let updateCanonicalAliasAltAliasesClosure = updateCanonicalAliasAltAliasesClosure {
|
||||
return await updateCanonicalAliasAltAliasesClosure(alias, altAliases)
|
||||
} else {
|
||||
return updateCanonicalAliasAltAliasesReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - publishRoomAliasInRoomDirectory
|
||||
|
||||
var publishRoomAliasInRoomDirectoryUnderlyingCallsCount = 0
|
||||
var publishRoomAliasInRoomDirectoryCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return publishRoomAliasInRoomDirectoryUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = publishRoomAliasInRoomDirectoryUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
publishRoomAliasInRoomDirectoryUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
publishRoomAliasInRoomDirectoryUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var publishRoomAliasInRoomDirectoryCalled: Bool {
|
||||
return publishRoomAliasInRoomDirectoryCallsCount > 0
|
||||
}
|
||||
var publishRoomAliasInRoomDirectoryReceivedAlias: String?
|
||||
var publishRoomAliasInRoomDirectoryReceivedInvocations: [String] = []
|
||||
|
||||
var publishRoomAliasInRoomDirectoryUnderlyingReturnValue: Result<Bool, RoomProxyError>!
|
||||
var publishRoomAliasInRoomDirectoryReturnValue: Result<Bool, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return publishRoomAliasInRoomDirectoryUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Bool, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = publishRoomAliasInRoomDirectoryUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
publishRoomAliasInRoomDirectoryUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
publishRoomAliasInRoomDirectoryUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var publishRoomAliasInRoomDirectoryClosure: ((String) async -> Result<Bool, RoomProxyError>)?
|
||||
|
||||
func publishRoomAliasInRoomDirectory(_ alias: String) async -> Result<Bool, RoomProxyError> {
|
||||
publishRoomAliasInRoomDirectoryCallsCount += 1
|
||||
publishRoomAliasInRoomDirectoryReceivedAlias = alias
|
||||
DispatchQueue.main.async {
|
||||
self.publishRoomAliasInRoomDirectoryReceivedInvocations.append(alias)
|
||||
}
|
||||
if let publishRoomAliasInRoomDirectoryClosure = publishRoomAliasInRoomDirectoryClosure {
|
||||
return await publishRoomAliasInRoomDirectoryClosure(alias)
|
||||
} else {
|
||||
return publishRoomAliasInRoomDirectoryReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - removeRoomAliasFromRoomDirectory
|
||||
|
||||
var removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = 0
|
||||
var removeRoomAliasFromRoomDirectoryCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return removeRoomAliasFromRoomDirectoryUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = removeRoomAliasFromRoomDirectoryUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
removeRoomAliasFromRoomDirectoryUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var removeRoomAliasFromRoomDirectoryCalled: Bool {
|
||||
return removeRoomAliasFromRoomDirectoryCallsCount > 0
|
||||
}
|
||||
var removeRoomAliasFromRoomDirectoryReceivedAlias: String?
|
||||
var removeRoomAliasFromRoomDirectoryReceivedInvocations: [String] = []
|
||||
|
||||
var removeRoomAliasFromRoomDirectoryUnderlyingReturnValue: Result<Bool, RoomProxyError>!
|
||||
var removeRoomAliasFromRoomDirectoryReturnValue: Result<Bool, RoomProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return removeRoomAliasFromRoomDirectoryUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<Bool, RoomProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = removeRoomAliasFromRoomDirectoryUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
removeRoomAliasFromRoomDirectoryUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
removeRoomAliasFromRoomDirectoryUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var removeRoomAliasFromRoomDirectoryClosure: ((String) async -> Result<Bool, RoomProxyError>)?
|
||||
|
||||
func removeRoomAliasFromRoomDirectory(_ alias: String) async -> Result<Bool, RoomProxyError> {
|
||||
removeRoomAliasFromRoomDirectoryCallsCount += 1
|
||||
removeRoomAliasFromRoomDirectoryReceivedAlias = alias
|
||||
DispatchQueue.main.async {
|
||||
self.removeRoomAliasFromRoomDirectoryReceivedInvocations.append(alias)
|
||||
}
|
||||
if let removeRoomAliasFromRoomDirectoryClosure = removeRoomAliasFromRoomDirectoryClosure {
|
||||
return await removeRoomAliasFromRoomDirectoryClosure(alias)
|
||||
} else {
|
||||
return removeRoomAliasFromRoomDirectoryReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - flagAsUnread
|
||||
|
||||
var flagAsUnreadUnderlyingCallsCount = 0
|
||||
|
||||
@@ -625,52 +625,6 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - createRoomAlias
|
||||
|
||||
open var createRoomAliasRoomAliasRoomIdThrowableError: Error?
|
||||
var createRoomAliasRoomAliasRoomIdUnderlyingCallsCount = 0
|
||||
open var createRoomAliasRoomAliasRoomIdCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return createRoomAliasRoomAliasRoomIdUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = createRoomAliasRoomAliasRoomIdUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
createRoomAliasRoomAliasRoomIdUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
createRoomAliasRoomAliasRoomIdUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var createRoomAliasRoomAliasRoomIdCalled: Bool {
|
||||
return createRoomAliasRoomAliasRoomIdCallsCount > 0
|
||||
}
|
||||
open var createRoomAliasRoomAliasRoomIdReceivedArguments: (roomAlias: String, roomId: String)?
|
||||
open var createRoomAliasRoomAliasRoomIdReceivedInvocations: [(roomAlias: String, roomId: String)] = []
|
||||
open var createRoomAliasRoomAliasRoomIdClosure: ((String, String) async throws -> Void)?
|
||||
|
||||
open override func createRoomAlias(roomAlias: String, roomId: String) async throws {
|
||||
if let error = createRoomAliasRoomAliasRoomIdThrowableError {
|
||||
throw error
|
||||
}
|
||||
createRoomAliasRoomAliasRoomIdCallsCount += 1
|
||||
createRoomAliasRoomAliasRoomIdReceivedArguments = (roomAlias: roomAlias, roomId: roomId)
|
||||
DispatchQueue.main.async {
|
||||
self.createRoomAliasRoomAliasRoomIdReceivedInvocations.append((roomAlias: roomAlias, roomId: roomId))
|
||||
}
|
||||
try await createRoomAliasRoomAliasRoomIdClosure?(roomAlias, roomId)
|
||||
}
|
||||
|
||||
//MARK: - customLoginWithJwt
|
||||
|
||||
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdThrowableError: Error?
|
||||
@@ -11326,6 +11280,46 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
try await editEventIdNewContentClosure?(eventId, newContent)
|
||||
}
|
||||
|
||||
//MARK: - enableEncryption
|
||||
|
||||
open var enableEncryptionThrowableError: Error?
|
||||
var enableEncryptionUnderlyingCallsCount = 0
|
||||
open var enableEncryptionCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return enableEncryptionUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = enableEncryptionUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
enableEncryptionUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
enableEncryptionUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var enableEncryptionCalled: Bool {
|
||||
return enableEncryptionCallsCount > 0
|
||||
}
|
||||
open var enableEncryptionClosure: (() async throws -> Void)?
|
||||
|
||||
open override func enableEncryption() async throws {
|
||||
if let error = enableEncryptionThrowableError {
|
||||
throw error
|
||||
}
|
||||
enableEncryptionCallsCount += 1
|
||||
try await enableEncryptionClosure?()
|
||||
}
|
||||
|
||||
//MARK: - enableSendQueue
|
||||
|
||||
var enableSendQueueEnableUnderlyingCallsCount = 0
|
||||
@@ -11437,6 +11431,75 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - getRoomVisibility
|
||||
|
||||
open var getRoomVisibilityThrowableError: Error?
|
||||
var getRoomVisibilityUnderlyingCallsCount = 0
|
||||
open var getRoomVisibilityCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getRoomVisibilityUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getRoomVisibilityUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getRoomVisibilityUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getRoomVisibilityUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var getRoomVisibilityCalled: Bool {
|
||||
return getRoomVisibilityCallsCount > 0
|
||||
}
|
||||
|
||||
var getRoomVisibilityUnderlyingReturnValue: RoomVisibility!
|
||||
open var getRoomVisibilityReturnValue: RoomVisibility! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getRoomVisibilityUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: RoomVisibility? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getRoomVisibilityUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getRoomVisibilityUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getRoomVisibilityUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var getRoomVisibilityClosure: (() async throws -> RoomVisibility)?
|
||||
|
||||
open override func getRoomVisibility() async throws -> RoomVisibility {
|
||||
if let error = getRoomVisibilityThrowableError {
|
||||
throw error
|
||||
}
|
||||
getRoomVisibilityCallsCount += 1
|
||||
if let getRoomVisibilityClosure = getRoomVisibilityClosure {
|
||||
return try await getRoomVisibilityClosure()
|
||||
} else {
|
||||
return getRoomVisibilityReturnValue
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - hasActiveRoomCall
|
||||
|
||||
var hasActiveRoomCallUnderlyingCallsCount = 0
|
||||
@@ -13387,6 +13450,81 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - publishRoomAliasInRoomDirectory
|
||||
|
||||
open var publishRoomAliasInRoomDirectoryAliasThrowableError: Error?
|
||||
var publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount = 0
|
||||
open var publishRoomAliasInRoomDirectoryAliasCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var publishRoomAliasInRoomDirectoryAliasCalled: Bool {
|
||||
return publishRoomAliasInRoomDirectoryAliasCallsCount > 0
|
||||
}
|
||||
open var publishRoomAliasInRoomDirectoryAliasReceivedAlias: String?
|
||||
open var publishRoomAliasInRoomDirectoryAliasReceivedInvocations: [String] = []
|
||||
|
||||
var publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue: Bool!
|
||||
open var publishRoomAliasInRoomDirectoryAliasReturnValue: Bool! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Bool? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var publishRoomAliasInRoomDirectoryAliasClosure: ((String) async throws -> Bool)?
|
||||
|
||||
open override func publishRoomAliasInRoomDirectory(alias: String) async throws -> Bool {
|
||||
if let error = publishRoomAliasInRoomDirectoryAliasThrowableError {
|
||||
throw error
|
||||
}
|
||||
publishRoomAliasInRoomDirectoryAliasCallsCount += 1
|
||||
publishRoomAliasInRoomDirectoryAliasReceivedAlias = alias
|
||||
DispatchQueue.main.async {
|
||||
self.publishRoomAliasInRoomDirectoryAliasReceivedInvocations.append(alias)
|
||||
}
|
||||
if let publishRoomAliasInRoomDirectoryAliasClosure = publishRoomAliasInRoomDirectoryAliasClosure {
|
||||
return try await publishRoomAliasInRoomDirectoryAliasClosure(alias)
|
||||
} else {
|
||||
return publishRoomAliasInRoomDirectoryAliasReturnValue
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - rawName
|
||||
|
||||
var rawNameUnderlyingCallsCount = 0
|
||||
@@ -13538,6 +13676,81 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
try await removeAvatarClosure?()
|
||||
}
|
||||
|
||||
//MARK: - removeRoomAliasFromRoomDirectory
|
||||
|
||||
open var removeRoomAliasFromRoomDirectoryAliasThrowableError: Error?
|
||||
var removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount = 0
|
||||
open var removeRoomAliasFromRoomDirectoryAliasCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var removeRoomAliasFromRoomDirectoryAliasCalled: Bool {
|
||||
return removeRoomAliasFromRoomDirectoryAliasCallsCount > 0
|
||||
}
|
||||
open var removeRoomAliasFromRoomDirectoryAliasReceivedAlias: String?
|
||||
open var removeRoomAliasFromRoomDirectoryAliasReceivedInvocations: [String] = []
|
||||
|
||||
var removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue: Bool!
|
||||
open var removeRoomAliasFromRoomDirectoryAliasReturnValue: Bool! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Bool? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var removeRoomAliasFromRoomDirectoryAliasClosure: ((String) async throws -> Bool)?
|
||||
|
||||
open override func removeRoomAliasFromRoomDirectory(alias: String) async throws -> Bool {
|
||||
if let error = removeRoomAliasFromRoomDirectoryAliasThrowableError {
|
||||
throw error
|
||||
}
|
||||
removeRoomAliasFromRoomDirectoryAliasCallsCount += 1
|
||||
removeRoomAliasFromRoomDirectoryAliasReceivedAlias = alias
|
||||
DispatchQueue.main.async {
|
||||
self.removeRoomAliasFromRoomDirectoryAliasReceivedInvocations.append(alias)
|
||||
}
|
||||
if let removeRoomAliasFromRoomDirectoryAliasClosure = removeRoomAliasFromRoomDirectoryAliasClosure {
|
||||
return try await removeRoomAliasFromRoomDirectoryAliasClosure(alias)
|
||||
} else {
|
||||
return removeRoomAliasFromRoomDirectoryAliasReturnValue
|
||||
}
|
||||
}
|
||||
|
||||
//MARK: - reportContent
|
||||
|
||||
open var reportContentEventIdScoreReasonThrowableError: Error?
|
||||
@@ -14863,6 +15076,144 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
try await unbanUserUserIdReasonClosure?(userId, reason)
|
||||
}
|
||||
|
||||
//MARK: - updateCanonicalAlias
|
||||
|
||||
open var updateCanonicalAliasAliasAltAliasesThrowableError: Error?
|
||||
var updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount = 0
|
||||
open var updateCanonicalAliasAliasAltAliasesCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var updateCanonicalAliasAliasAltAliasesCalled: Bool {
|
||||
return updateCanonicalAliasAliasAltAliasesCallsCount > 0
|
||||
}
|
||||
open var updateCanonicalAliasAliasAltAliasesReceivedArguments: (alias: String?, altAliases: [String])?
|
||||
open var updateCanonicalAliasAliasAltAliasesReceivedInvocations: [(alias: String?, altAliases: [String])] = []
|
||||
open var updateCanonicalAliasAliasAltAliasesClosure: ((String?, [String]) async throws -> Void)?
|
||||
|
||||
open override func updateCanonicalAlias(alias: String?, altAliases: [String]) async throws {
|
||||
if let error = updateCanonicalAliasAliasAltAliasesThrowableError {
|
||||
throw error
|
||||
}
|
||||
updateCanonicalAliasAliasAltAliasesCallsCount += 1
|
||||
updateCanonicalAliasAliasAltAliasesReceivedArguments = (alias: alias, altAliases: altAliases)
|
||||
DispatchQueue.main.async {
|
||||
self.updateCanonicalAliasAliasAltAliasesReceivedInvocations.append((alias: alias, altAliases: altAliases))
|
||||
}
|
||||
try await updateCanonicalAliasAliasAltAliasesClosure?(alias, altAliases)
|
||||
}
|
||||
|
||||
//MARK: - updateHistoryVisibility
|
||||
|
||||
open var updateHistoryVisibilityVisibilityThrowableError: Error?
|
||||
var updateHistoryVisibilityVisibilityUnderlyingCallsCount = 0
|
||||
open var updateHistoryVisibilityVisibilityCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateHistoryVisibilityVisibilityUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateHistoryVisibilityVisibilityUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateHistoryVisibilityVisibilityUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateHistoryVisibilityVisibilityUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var updateHistoryVisibilityVisibilityCalled: Bool {
|
||||
return updateHistoryVisibilityVisibilityCallsCount > 0
|
||||
}
|
||||
open var updateHistoryVisibilityVisibilityReceivedVisibility: RoomHistoryVisibility?
|
||||
open var updateHistoryVisibilityVisibilityReceivedInvocations: [RoomHistoryVisibility] = []
|
||||
open var updateHistoryVisibilityVisibilityClosure: ((RoomHistoryVisibility) async throws -> Void)?
|
||||
|
||||
open override func updateHistoryVisibility(visibility: RoomHistoryVisibility) async throws {
|
||||
if let error = updateHistoryVisibilityVisibilityThrowableError {
|
||||
throw error
|
||||
}
|
||||
updateHistoryVisibilityVisibilityCallsCount += 1
|
||||
updateHistoryVisibilityVisibilityReceivedVisibility = visibility
|
||||
DispatchQueue.main.async {
|
||||
self.updateHistoryVisibilityVisibilityReceivedInvocations.append(visibility)
|
||||
}
|
||||
try await updateHistoryVisibilityVisibilityClosure?(visibility)
|
||||
}
|
||||
|
||||
//MARK: - updateJoinRules
|
||||
|
||||
open var updateJoinRulesNewRuleThrowableError: Error?
|
||||
var updateJoinRulesNewRuleUnderlyingCallsCount = 0
|
||||
open var updateJoinRulesNewRuleCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateJoinRulesNewRuleUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateJoinRulesNewRuleUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateJoinRulesNewRuleUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateJoinRulesNewRuleUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var updateJoinRulesNewRuleCalled: Bool {
|
||||
return updateJoinRulesNewRuleCallsCount > 0
|
||||
}
|
||||
open var updateJoinRulesNewRuleReceivedNewRule: JoinRule?
|
||||
open var updateJoinRulesNewRuleReceivedInvocations: [JoinRule] = []
|
||||
open var updateJoinRulesNewRuleClosure: ((JoinRule) async throws -> Void)?
|
||||
|
||||
open override func updateJoinRules(newRule: JoinRule) async throws {
|
||||
if let error = updateJoinRulesNewRuleThrowableError {
|
||||
throw error
|
||||
}
|
||||
updateJoinRulesNewRuleCallsCount += 1
|
||||
updateJoinRulesNewRuleReceivedNewRule = newRule
|
||||
DispatchQueue.main.async {
|
||||
self.updateJoinRulesNewRuleReceivedInvocations.append(newRule)
|
||||
}
|
||||
try await updateJoinRulesNewRuleClosure?(newRule)
|
||||
}
|
||||
|
||||
//MARK: - updatePowerLevelsForUsers
|
||||
|
||||
open var updatePowerLevelsForUsersUpdatesThrowableError: Error?
|
||||
@@ -14909,6 +15260,52 @@ open class RoomSDKMock: MatrixRustSDK.Room {
|
||||
try await updatePowerLevelsForUsersUpdatesClosure?(updates)
|
||||
}
|
||||
|
||||
//MARK: - updateRoomVisibility
|
||||
|
||||
open var updateRoomVisibilityVisibilityThrowableError: Error?
|
||||
var updateRoomVisibilityVisibilityUnderlyingCallsCount = 0
|
||||
open var updateRoomVisibilityVisibilityCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return updateRoomVisibilityVisibilityUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = updateRoomVisibilityVisibilityUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
updateRoomVisibilityVisibilityUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
updateRoomVisibilityVisibilityUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var updateRoomVisibilityVisibilityCalled: Bool {
|
||||
return updateRoomVisibilityVisibilityCallsCount > 0
|
||||
}
|
||||
open var updateRoomVisibilityVisibilityReceivedVisibility: RoomVisibility?
|
||||
open var updateRoomVisibilityVisibilityReceivedInvocations: [RoomVisibility] = []
|
||||
open var updateRoomVisibilityVisibilityClosure: ((RoomVisibility) async throws -> Void)?
|
||||
|
||||
open override func updateRoomVisibility(visibility: RoomVisibility) async throws {
|
||||
if let error = updateRoomVisibilityVisibilityThrowableError {
|
||||
throw error
|
||||
}
|
||||
updateRoomVisibilityVisibilityCallsCount += 1
|
||||
updateRoomVisibilityVisibilityReceivedVisibility = visibility
|
||||
DispatchQueue.main.async {
|
||||
self.updateRoomVisibilityVisibilityReceivedInvocations.append(visibility)
|
||||
}
|
||||
try await updateRoomVisibilityVisibilityClosure?(visibility)
|
||||
}
|
||||
|
||||
//MARK: - uploadAvatar
|
||||
|
||||
open var uploadAvatarMimeTypeDataMediaInfoThrowableError: Error?
|
||||
@@ -22276,6 +22673,46 @@ open class UserIdentitySDKMock: MatrixRustSDK.UserIdentity {
|
||||
pinCallsCount += 1
|
||||
try await pinClosure?()
|
||||
}
|
||||
|
||||
//MARK: - withdrawVerification
|
||||
|
||||
open var withdrawVerificationThrowableError: Error?
|
||||
var withdrawVerificationUnderlyingCallsCount = 0
|
||||
open var withdrawVerificationCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return withdrawVerificationUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = withdrawVerificationUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
withdrawVerificationUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
withdrawVerificationUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
open var withdrawVerificationCalled: Bool {
|
||||
return withdrawVerificationCallsCount > 0
|
||||
}
|
||||
open var withdrawVerificationClosure: (() async throws -> Void)?
|
||||
|
||||
open override func withdrawVerification() async throws {
|
||||
if let error = withdrawVerificationThrowableError {
|
||||
throw error
|
||||
}
|
||||
withdrawVerificationCallsCount += 1
|
||||
try await withdrawVerificationClosure?()
|
||||
}
|
||||
}
|
||||
open class WidgetDriverSDKMock: MatrixRustSDK.WidgetDriver {
|
||||
init() {
|
||||
|
||||
@@ -60,7 +60,8 @@ extension RoomInfo {
|
||||
numUnreadNotifications: 0,
|
||||
numUnreadMentions: 0,
|
||||
pinnedEventIds: [],
|
||||
joinRule: .invite)
|
||||
joinRule: .invite,
|
||||
historyVisibility: .shared)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ struct JoinedRoomProxyMockConfiguration {
|
||||
|
||||
var shouldUseAutoUpdatingTimeline = false
|
||||
var joinRule: JoinRule?
|
||||
var isVisibleInPublicDirectory = false
|
||||
}
|
||||
|
||||
extension JoinedRoomProxyMock {
|
||||
@@ -127,6 +128,7 @@ extension JoinedRoomProxyMock {
|
||||
loadDraftReturnValue = .success(nil)
|
||||
clearDraftReturnValue = .success(())
|
||||
sendTypingNotificationIsTypingReturnValue = .success(())
|
||||
isVisibleInRoomDirectoryReturnValue = .success(configuration.isVisibleInPublicDirectory)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,6 +172,7 @@ extension RoomInfo {
|
||||
numUnreadNotifications: 0,
|
||||
numUnreadMentions: 0,
|
||||
pinnedEventIds: Array(configuration.pinnedEventIDs),
|
||||
joinRule: configuration.joinRule)
|
||||
joinRule: configuration.joinRule,
|
||||
historyVisibility: .shared)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ extension RoomInfo {
|
||||
numUnreadNotifications: 0,
|
||||
numUnreadMentions: 0,
|
||||
pinnedEventIds: [],
|
||||
joinRule: .knock)
|
||||
joinRule: .knock,
|
||||
historyVisibility: .shared)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user