Sdk v1.0.47 (#3265)

This commit is contained in:
Mauro
2024-09-11 15:55:15 +02:00
committed by GitHub
parent b85bd602f5
commit 0d9d8f9fa4
9 changed files with 24 additions and 140 deletions
@@ -156,7 +156,7 @@ final class TimelineProxy: TimelineProxyProtocol {
func edit(_ timelineItem: EventTimelineItem, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, TimelineProxyError> {
do {
guard try await timeline.edit(item: timelineItem, newContent: newContent) == true else {
guard try await timeline.edit(item: timelineItem, newContent: .roomMessage(content: newContent)) == true else {
return .failure(.failedEditing)
}
@@ -460,7 +460,13 @@ final class TimelineProxy: TimelineProxyProtocol {
do {
let originalEvent = try await timeline.getEventTimelineItemByEventId(eventId: eventID)
try await timeline.editPoll(question: question, answers: answers, maxSelections: 1, pollKind: .init(pollKind: pollKind), editItem: originalEvent)
guard try await timeline.edit(item: originalEvent,
newContent: .pollStart(pollData: .init(question: question,
answers: answers,
maxSelections: 1,
pollKind: .init(pollKind: pollKind)))) else {
return .failure(.failedEditing)
}
MXLog.info("Finished editing poll with eventID: \(eventID)")