Forward current composer text to the new poll form to serve as the question/topic

This commit is contained in:
Stefan Ceriu
2026-05-22 13:01:22 +03:00
parent ac20ff0fc3
commit 77c5aba326
11 changed files with 26 additions and 21 deletions
@@ -16,7 +16,7 @@ enum TimelineInteractionHandlerAction {
case displayReportContent(itemID: TimelineItemIdentifier, senderID: String)
case displayMessageForwarding(itemID: TimelineItemIdentifier)
case displayMediaUploadPreviewScreen(mediaURLs: [URL])
case displayPollForm(mode: PollFormMode)
case displayEditPollForm(eventID: String, poll: Poll)
case showActionMenu(TimelineItemActionMenuInfo)
case showDebugInfo(TimelineItemDebugInfo)
@@ -130,7 +130,7 @@ class TimelineInteractionHandler {
MXLog.error("Cannot edit poll with id: \(timelineItem.id)")
return
}
actionsSubject.send(.displayPollForm(mode: .edit(eventID: eventID, poll: pollTimelineItem.poll)))
actionsSubject.send(.displayEditPollForm(eventID: eventID, poll: pollTimelineItem.poll))
default:
MXLog.error("Cannot edit item with id: \(timelineItem.id)")
}
@@ -18,7 +18,8 @@ enum TimelineViewModelAction {
case displayMediaPicker
case displayDocumentPicker
case displayLocationPicker
case displayPollForm(mode: PollFormMode)
case displayNewPollForm
case displayEditPollForm(eventID: String, poll: Poll)
case displayMediaUploadPreviewScreen(mediaURLs: [URL])
case displaySenderDetails(userID: String)
case displayMessageForwarding(forwardingItem: MessageForwardingItem)
@@ -370,7 +370,7 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
case .location:
actionsSubject.send(.displayLocationPicker)
case .poll:
actionsSubject.send(.displayPollForm(mode: .new))
actionsSubject.send(.displayNewPollForm)
}
}
@@ -380,8 +380,8 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
timelineInteractionHandler.sendPollResponse(pollStartID: pollStartID, optionID: optionID)
case let .end(pollStartID):
displayAlert(.pollEndConfirmation(pollStartID))
case .edit(let pollStartID, let poll):
actionsSubject.send(.displayPollForm(mode: .edit(eventID: pollStartID, poll: poll)))
case .edit(let eventID, let poll):
actionsSubject.send(.displayEditPollForm(eventID: eventID, poll: poll))
}
}
@@ -514,8 +514,8 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
actionsSubject.send(.displayEmojiPicker(itemID: itemID, selectedEmojis: selectedEmojis))
case .displayMessageForwarding(let itemID):
Task { await self.forwardMessage(itemID: itemID) }
case .displayPollForm(let mode):
actionsSubject.send(.displayPollForm(mode: mode))
case .displayEditPollForm(let eventID, let poll):
actionsSubject.send(.displayEditPollForm(eventID: eventID, poll: poll))
case .displayReportContent(let itemID, let senderID):
actionsSubject.send(.displayReportContent(itemID: itemID, senderID: senderID))
case .displayMediaUploadPreviewScreen(let mediaURLs):