mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Vote on a poll and end a poll (#1597)
* Fix project file * Add vote and end poll actions * Handle redaction * Fix local echo behavior * Cleanup * Fix UI tests * Add localisation * Cleanup * Fix end poll action style
This commit is contained in:
@@ -26,7 +26,7 @@ struct TimelineItemIdentifier: Hashable {
|
||||
/// Only available for EventTimelineItem and only when the item is returned by the server.
|
||||
var eventID: String?
|
||||
|
||||
/// Uniquely identfies the local echo of the timeline item.
|
||||
/// Uniquely identifies the local echo of the timeline item.
|
||||
/// Only available for sent EventTimelineItem that have not been returned by the server yet.
|
||||
var transactionID: String?
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ extension EventBasedTimelineItemProtocol {
|
||||
self is LocationRoomTimelineItem
|
||||
}
|
||||
|
||||
var pollIfAvailable: Poll? {
|
||||
(self as? PollRoomTimelineItem)?.poll
|
||||
}
|
||||
|
||||
var isRedacted: Bool {
|
||||
self is RedactedRoomTimelineItem
|
||||
}
|
||||
|
||||
+4
@@ -35,6 +35,10 @@ struct Poll: Equatable {
|
||||
let votes: [String: [String]]
|
||||
let endDate: Date?
|
||||
|
||||
var hasEnded: Bool {
|
||||
endDate != nil
|
||||
}
|
||||
|
||||
enum Kind: Equatable {
|
||||
case disclosed
|
||||
case undisclosed
|
||||
|
||||
Reference in New Issue
Block a user