Display reactions with all message types

This commit is contained in:
Ali
2021-11-16 21:00:15 +04:00
parent 60b9b135e3
commit a02157d1b2
16 changed files with 213 additions and 14 deletions

View File

@@ -224,7 +224,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
private var contentFileNode: ChatMessageInteractiveFileNode?
private var buttonNode: ChatMessageAttachedContentButtonNode?
private let statusNode: ChatMessageDateAndStatusNode
let statusNode: ChatMessageDateAndStatusNode
private var additionalImageBadgeNode: ChatMessageInteractiveMediaBadge?
private var linkHighlightingNode: LinkHighlightingNode?
@@ -322,7 +322,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
}
var viewCount: Int?
var dateReplies = 0
let dateReactions: [MessageReaction] = []
var dateReactions: [MessageReaction] = []
for attribute in message.attributes {
if let attribute = attribute as? EditedMessageAttribute {
edited = !attribute.isHidden
@@ -332,6 +332,10 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .group = channel.info {
dateReplies = Int(attribute.count)
}
} else if let attribute = attribute as? PendingReactionsMessageAttribute {
if let value = attribute.value {
dateReactions = [MessageReaction(value: value, count: 1, isSelected: true)]
}
}
}