Update the SDK.

This commit is contained in:
Doug
2024-08-29 14:39:49 +01:00
committed by Stefan Ceriu
parent 4925884f6c
commit 342ad57ce7
8 changed files with 37 additions and 117 deletions
@@ -178,12 +178,8 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async {
MXLog.info("Toggle reaction in \(roomID)")
guard let eventID = itemID.eventID else {
MXLog.error("Failed toggling reaction: missing eventID")
return
}
switch await activeTimeline.toggleReaction(reaction, to: eventID) {
switch await activeTimeline.toggleReaction(reaction, to: itemID) {
case .success:
MXLog.info("Finished toggling reaction")
case .failure(let error):
@@ -430,15 +430,15 @@ final class TimelineProxy: TimelineProxyProtocol {
}
}
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, TimelineProxyError> {
MXLog.info("Toggling reaction for eventID: \(eventID)")
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async -> Result<Void, TimelineProxyError> {
MXLog.info("Toggling reaction for event: \(itemID)")
do {
try await timeline.toggleReaction(eventId: eventID, key: reaction)
MXLog.info("Finished toggling reaction for eventID: \(eventID)")
try await timeline.toggleReaction(uniqueId: itemID.timelineID, key: reaction)
MXLog.info("Finished toggling reaction for event: \(itemID)")
return .success(())
} catch {
MXLog.error("Failed toggling reaction for eventID: \(eventID)")
MXLog.error("Failed toggling reaction for event: \(itemID)")
return .failure(.sdkError(error))
}
}
@@ -101,7 +101,7 @@ protocol TimelineProxyProtocol {
inReplyTo eventID: String?,
intentionalMentions: IntentionalMentions) async -> Result<Void, TimelineProxyError>
func toggleReaction(_ reaction: String, to eventID: String) async -> Result<Void, TimelineProxyError>
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async -> Result<Void, TimelineProxyError>
// Polls
func createPoll(question: String, answers: [String], pollKind: Poll.Kind) async -> Result<Void, TimelineProxyError>