From 6fc193995ef3c81c4e3e44778c91b9de9e8e1960 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 15 Feb 2024 20:00:36 -0400 Subject: [PATCH] Various fixes --- submodules/AvatarNode/Sources/AvatarNode.swift | 7 +++++-- .../Sources/PeerInfoAvatarTransformContainerNode.swift | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/submodules/AvatarNode/Sources/AvatarNode.swift b/submodules/AvatarNode/Sources/AvatarNode.swift index 565946d3e01..937be9432cf 100644 --- a/submodules/AvatarNode/Sources/AvatarNode.swift +++ b/submodules/AvatarNode/Sources/AvatarNode.swift @@ -1227,15 +1227,18 @@ public final class AvatarNode: ASDisplayNode { public var colors: Colors public var lineWidth: CGFloat public var inactiveLineWidth: CGFloat + public var forceRoundedRect: Bool public init( colors: Colors, lineWidth: CGFloat, - inactiveLineWidth: CGFloat + inactiveLineWidth: CGFloat, + forceRoundedRect: Bool = false ) { self.colors = colors self.lineWidth = lineWidth self.inactiveLineWidth = inactiveLineWidth + self.forceRoundedRect = forceRoundedRect } } @@ -1290,7 +1293,7 @@ public final class AvatarNode: ASDisplayNode { unseenCount: storyStats.unseenCount ), progress: mappedProgress, - isRoundedRect: self.contentNode.clipStyle == .roundedRect + isRoundedRect: self.contentNode.clipStyle == .roundedRect || storyPresentationParams.forceRoundedRect )), environment: {}, containerSize: indicatorSize diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift index 7eb9cac1652..ce140b8747e 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift @@ -126,10 +126,17 @@ final class PeerInfoAvatarTransformContainerNode: ASDisplayNode { progress: storyProgress ) } + + var isForum = false + if let peer, let channel = peer as? TelegramChannel, channel.isForum { + isForum = true + } + self.avatarNode.setStoryStats(storyStats: storyStats, presentationParams: AvatarNode.StoryPresentationParams( colors: colors, lineWidth: 3.0, - inactiveLineWidth: 1.5 + inactiveLineWidth: 1.5, + forceRoundedRect: isForum ), transition: Transition(transition)) }