feat: decline and block screen

fix

improvement

fix conflict

fix tests

tests
This commit is contained in:
Mauro Romito
2025-04-03 17:36:34 +02:00
committed by Mauro
parent 2ee5c1b403
commit d92fecdc7e
32 changed files with 597 additions and 13 deletions
@@ -3383,6 +3383,76 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
return roomSummaryForAliasReturnValue
}
}
//MARK: - reportRoomForIdentifier
var reportRoomForIdentifierReasonUnderlyingCallsCount = 0
var reportRoomForIdentifierReasonCallsCount: Int {
get {
if Thread.isMainThread {
return reportRoomForIdentifierReasonUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = reportRoomForIdentifierReasonUnderlyingCallsCount
}
return returnValue!
}
}
set {
if Thread.isMainThread {
reportRoomForIdentifierReasonUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
reportRoomForIdentifierReasonUnderlyingCallsCount = newValue
}
}
}
}
var reportRoomForIdentifierReasonCalled: Bool {
return reportRoomForIdentifierReasonCallsCount > 0
}
var reportRoomForIdentifierReasonReceivedArguments: (identifier: String, reason: String?)?
var reportRoomForIdentifierReasonReceivedInvocations: [(identifier: String, reason: String?)] = []
var reportRoomForIdentifierReasonUnderlyingReturnValue: Result<Void, ClientProxyError>!
var reportRoomForIdentifierReasonReturnValue: Result<Void, ClientProxyError>! {
get {
if Thread.isMainThread {
return reportRoomForIdentifierReasonUnderlyingReturnValue
} else {
var returnValue: Result<Void, ClientProxyError>? = nil
DispatchQueue.main.sync {
returnValue = reportRoomForIdentifierReasonUnderlyingReturnValue
}
return returnValue!
}
}
set {
if Thread.isMainThread {
reportRoomForIdentifierReasonUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
reportRoomForIdentifierReasonUnderlyingReturnValue = newValue
}
}
}
}
var reportRoomForIdentifierReasonClosure: ((String, String?) async -> Result<Void, ClientProxyError>)?
func reportRoomForIdentifier(_ identifier: String, reason: String?) async -> Result<Void, ClientProxyError> {
reportRoomForIdentifierReasonCallsCount += 1
reportRoomForIdentifierReasonReceivedArguments = (identifier: identifier, reason: reason)
DispatchQueue.main.async {
self.reportRoomForIdentifierReasonReceivedInvocations.append((identifier: identifier, reason: reason))
}
if let reportRoomForIdentifierReasonClosure = reportRoomForIdentifierReasonClosure {
return await reportRoomForIdentifierReasonClosure(identifier, reason)
} else {
return reportRoomForIdentifierReasonReturnValue
}
}
//MARK: - loadUserDisplayName
var loadUserDisplayNameUnderlyingCallsCount = 0