mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Sort reactions on the timeline by count and then timestamp and show the date on the summary view (#1320)
* Sort timetamps on timeline and show the date on the summary view - Sort reaction aggregations on the timeline by count and then by most recent timestamp ascending(tagging new reactions on the end) - Show the timestamp on the summary view and sort descending(newest at the top) * Address comments. - Fix ID case. - Improve readability of components in body. - Improve the comments that describe the sorting.
This commit is contained in:
@@ -23,7 +23,15 @@ struct AggregatedReaction: Hashable {
|
||||
/// The reaction that was sent.
|
||||
let key: String
|
||||
/// The user ids of those who sent the reactions
|
||||
let senders: [String]
|
||||
let senders: [ReactionSender]
|
||||
}
|
||||
|
||||
/// Details of who sent the reaction
|
||||
struct ReactionSender: Hashable {
|
||||
/// The id of the user who sent the reaction
|
||||
let senderID: String
|
||||
/// The time that the reaction was received on the original homeserver
|
||||
let timestamp: Date
|
||||
}
|
||||
|
||||
extension AggregatedReaction {
|
||||
@@ -34,6 +42,6 @@ extension AggregatedReaction {
|
||||
|
||||
/// Whether to highlight the reaction, indicating that the current user sent this reaction.
|
||||
var isHighlighted: Bool {
|
||||
senders.contains(where: { $0 == accountOwnerID })
|
||||
senders.contains(where: { $0.senderID == accountOwnerID })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user