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
@@ -260,7 +260,7 @@ class RoomProxy: RoomProxyProtocol {
}
}
func sendReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError> {
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError> {
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
defer {
sendMessageBackgroundTask?.stop()
@@ -268,7 +268,7 @@ class RoomProxy: RoomProxyProtocol {
return await Task.dispatch(on: userInitiatedDispatchQueue) {
do {
try self.room.sendReaction(eventId: eventID, key: reaction)
try self.room.toggleReaction(eventId: eventID, key: reaction)
return .success(())
} catch {
return .failure(.failedSendingReaction)
@@ -92,7 +92,7 @@ protocol RoomProxyProtocol {
func sendMessage(_ message: String, inReplyTo eventID: String?) async -> Result<Void, RoomProxyError>
func sendReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError>
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, RoomProxyError>
func sendImage(url: URL, thumbnailURL: URL, imageInfo: ImageInfo, progressSubject: CurrentValueSubject<Double, Never>?) async -> Result<Void, RoomProxyError>