From 5439b650a0dc20c7332416fd1229d4d3278354d6 Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Fri, 27 Oct 2023 22:35:18 +0200 Subject: [PATCH] Remove forward action for polls (#1973) --- .../Sources/Screens/RoomScreen/RoomScreenViewModel.swift | 2 +- .../TimelineItems/EventBasedTimelineItemProtocol.swift | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift index dabd87779b..2eedfd32cf 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenViewModel.swift @@ -598,7 +598,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol } } - if item.isRemoteMessage { + if item.isForwardable { actions.append(.forward(itemID: itemID)) } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift index 94b7e17732..4c8fc18310 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/EventBasedTimelineItemProtocol.swift @@ -34,7 +34,11 @@ extension EventBasedTimelineItemProtocol { var description: String { "\(String(describing: Self.self)): id: \(id), timestamp: \(timestamp), isOutgoing: \(isOutgoing), properties: \(properties)" } - + + var isForwardable: Bool { + isRemoteMessage && !(self is PollRoomTimelineItem) + } + var isRemoteMessage: Bool { id.eventID != nil }