Allow the user to forward the same message to multiple rooms at once

This will send the item to the rooms in order they were chosen and only deep link
into the target room if single, otherwise it will just dismiss the forwarding screen
after sending.
This commit is contained in:
Stefan Ceriu
2026-05-27 13:55:35 +03:00
parent 7093d966b4
commit f040964d3f
7 changed files with 51 additions and 32 deletions
@@ -37,7 +37,7 @@ struct MessageForwardingScreenViewModelTests {
@Test
mutating func roomSelection() {
context.send(viewAction: .selectRoom(roomID: "2"))
#expect(context.viewState.selectedRoomID == "2")
#expect(context.viewState.selectedRoomIDs == ["2"])
}
@Test
@@ -54,12 +54,12 @@ struct MessageForwardingScreenViewModelTests {
@Test
mutating func forwarding() async throws {
context.send(viewAction: .selectRoom(roomID: "2"))
#expect(context.viewState.selectedRoomID == "2")
#expect(context.viewState.selectedRoomIDs == ["2"])
let deferred = deferFulfillment(viewModel.actions) { action in
switch action {
case .sent(let roomID):
return roomID == "2"
case .sent(let roomIDs):
return roomIDs == ["2"]
default:
return false
}