Rename sendReaction as toggleReaction

This commit is contained in:
aringenbach
2023-06-26 17:44:31 +02:00
committed by Stefan Ceriu
parent 7d3dcee5a3
commit 88ac3fb8c6
12 changed files with 32 additions and 32 deletions
@@ -610,25 +610,25 @@ class RoomProxyMock: RoomProxyProtocol {
return sendMessageInReplyToReturnValue
}
}
//MARK: - sendReaction
//MARK: - toggleReaction
var sendReactionToCallsCount = 0
var sendReactionToCalled: Bool {
return sendReactionToCallsCount > 0
var toggleReactionToCallsCount = 0
var toggleReactionToCalled: Bool {
return toggleReactionToCallsCount > 0
}
var sendReactionToReceivedArguments: (reaction: String, eventID: String)?
var sendReactionToReceivedInvocations: [(reaction: String, eventID: String)] = []
var sendReactionToReturnValue: Result<Void, RoomProxyError>!
var sendReactionToClosure: ((String, String) async -> Result<Void, RoomProxyError>)?
var toggleReactionToReceivedArguments: (reaction: String, eventID: String)?
var toggleReactionToReceivedInvocations: [(reaction: String, eventID: String)] = []
var toggleReactionToReturnValue: Result<Void, RoomProxyError>!
var toggleReactionToClosure: ((String, String) async -> Result<Void, RoomProxyError>)?
func sendReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError> {
sendReactionToCallsCount += 1
sendReactionToReceivedArguments = (reaction: reaction, eventID: eventID)
sendReactionToReceivedInvocations.append((reaction: reaction, eventID: eventID))
if let sendReactionToClosure = sendReactionToClosure {
return await sendReactionToClosure(reaction, eventID)
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError> {
toggleReactionToCallsCount += 1
toggleReactionToReceivedArguments = (reaction: reaction, eventID: eventID)
toggleReactionToReceivedInvocations.append((reaction: reaction, eventID: eventID))
if let toggleReactionToClosure = toggleReactionToClosure {
return await toggleReactionToClosure(reaction, eventID)
} else {
return sendReactionToReturnValue
return toggleReactionToReturnValue
}
}
//MARK: - sendImage