Move message forwarding out of the flow coordinator. (#2738)

This commit is contained in:
Doug
2024-05-07 15:04:11 +01:00
committed by GitHub
parent eac2552ab5
commit e829a3ded6
13 changed files with 140 additions and 92 deletions
@@ -15,10 +15,11 @@
//
import Foundation
import MatrixRustSDK
enum MessageForwardingScreenViewModelAction {
case dismiss
case send(roomID: String)
case sent(roomID: String)
}
struct MessageForwardingScreenViewState: BindableState {
@@ -45,3 +46,21 @@ struct MessageForwardingRoom: Identifiable, Equatable {
let alias: String?
let avatarURL: URL?
}
struct MessageForwardingItem: Hashable {
/// The source item's timeline ID. Only necessary for a rough Hashable conformance.
let id: TimelineItemIdentifier
/// The source item's room ID.
let roomID: String
/// The item's content to be forwarded.
let content: RoomMessageEventContentWithoutRelation
static func == (lhs: MessageForwardingItem, rhs: MessageForwardingItem) -> Bool {
lhs.id == rhs.id && lhs.roomID == rhs.roomID
}
func hash(into hasher: inout Hasher) {
hasher.combine(id)
hasher.combine(roomID)
}
}