mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
"View only" polls in the timeline (#1399)
* Add stub methods in RoomTimelineItemFactory * Add PollRoomTimelineView and PollEndRoomTimelineView * Add timeline skeleton * Start poll mapping * Add comment * Refine poll UI * Add feature flags for polls * Cleanup * Delete poll end event * Refine poll mapping * Refine poll layout * Reuse FormRowAccessory * Refine poll bubble layout * Localise strings * Update project * Refine poll preview * Map poll properties
This commit is contained in:
@@ -68,6 +68,7 @@ enum RoomTimelineItemType: Equatable {
|
||||
case state(StateRoomTimelineItem)
|
||||
case group(CollapsibleTimelineItem)
|
||||
case location(LocationRoomTimelineItem)
|
||||
case poll(PollRoomTimelineItem)
|
||||
|
||||
// swiftlint:disable:next cyclomatic_complexity
|
||||
init(item: RoomTimelineItemProtocol) {
|
||||
@@ -110,6 +111,8 @@ enum RoomTimelineItemType: Equatable {
|
||||
self = .group(item)
|
||||
case let item as LocationRoomTimelineItem:
|
||||
self = .location(item)
|
||||
case let item as PollRoomTimelineItem:
|
||||
self = .poll(item)
|
||||
default:
|
||||
fatalError("Unknown timeline item")
|
||||
}
|
||||
@@ -135,7 +138,8 @@ enum RoomTimelineItemType: Equatable {
|
||||
.encryptedHistory(let item as RoomTimelineItemProtocol),
|
||||
.state(let item as RoomTimelineItemProtocol),
|
||||
.group(let item as RoomTimelineItemProtocol),
|
||||
.location(let item as RoomTimelineItemProtocol):
|
||||
.location(let item as RoomTimelineItemProtocol),
|
||||
.poll(let item as RoomTimelineItemProtocol):
|
||||
return item.id
|
||||
}
|
||||
}
|
||||
@@ -143,7 +147,7 @@ enum RoomTimelineItemType: Equatable {
|
||||
/// Whether or not it is possible to send a reaction to this timeline item.
|
||||
var isReactable: Bool {
|
||||
switch self {
|
||||
case .text, .image, .video, .audio, .file, .emote, .notice, .sticker, .location:
|
||||
case .text, .image, .video, .audio, .file, .emote, .notice, .sticker, .location, .poll:
|
||||
return true
|
||||
case .redacted, .encrypted, .unsupported, .state: // Event based items that aren't reactable
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user