Limit conversations a message can be forwarded to (#5793)

* Limit conversations a message can be forwarded to

* Review fixups

* fix: remove the unused constant argument

---------

Co-authored-by: Mauro Romito <mauro.romito@element.io>
This commit is contained in:
Michael
2026-06-30 07:01:49 -05:00
committed by GitHub
parent 2d486ece33
commit ff9c260674
3 changed files with 12 additions and 4 deletions
@@ -63,10 +63,10 @@ class MessageForwardingScreenViewModel: MessageForwardingScreenViewModelType, Me
case .send:
Task { await forward() }
case .selectRoom(let roomID):
if let index = state.selectedRoomIDs.firstIndex(of: roomID) {
state.selectedRoomIDs.remove(at: index)
if state.selectedRoomIDs.contains(roomID) == false, state.selectedRoomIDs.count < state.maxRoomSelectionCount {
state.selectedRoomIDs.insert(roomID)
} else {
state.selectedRoomIDs.append(roomID)
state.selectedRoomIDs.remove(roomID)
}
case .reachedTop:
updateVisibleRange(edge: .top)