Use colored replies only in groups

This commit is contained in:
Ilya Laktyushin 2022-05-12 05:12:17 +04:00
parent 0d924184ce
commit d67875a3f6

View File

@ -75,7 +75,10 @@ class ChatMessageReplyInfoNode: ASDisplayNode {
let textColor: UIColor
let dustColor: UIColor
var authorNameColor: UIColor? = author.flatMap { chatMessagePeerIdColors[Int(clamping: $0.id.id._internalGetInt64Value() % 7)] }
var authorNameColor: UIColor?
if [Namespaces.Peer.CloudGroup, Namespaces.Peer.CloudChannel].contains(parentMessage.id.peerId.namespace) && author?.id.namespace == Namespaces.Peer.CloudUser {
authorNameColor = author.flatMap { chatMessagePeerIdColors[Int(clamping: $0.id.id._internalGetInt64Value() % 7)] }
if let rawAuthorNameColor = authorNameColor {
var dimColors = false
switch presentationData.theme.theme.name {
@ -92,6 +95,7 @@ class ChatMessageReplyInfoNode: ASDisplayNode {
authorNameColor = UIColor(hue: hue, saturation: saturation * 0.7, brightness: min(1.0, brightness * 1.2), alpha: 1.0)
}
}
}
switch type {
case let .bubble(incoming):