diff --git a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift index 64daba37ad..92eaa12538 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift @@ -145,6 +145,9 @@ private enum ChatListRecentEntry: Comparable, Identifiable { if case .secretChat = maybeChatPeer, let associatedPeerId = maybeChatPeer._asPeer().associatedPeerId, let associatedPeer = peer.peer.peers[associatedPeerId] { primaryPeer = EnginePeer(associatedPeer) chatPeer = maybeChatPeer + } else if case .channel = maybeChatPeer, let mainChannel = peer.peer.chatOrMonoforumMainPeer { + primaryPeer = EnginePeer(mainChannel) + chatPeer = maybeChatPeer } else { primaryPeer = maybeChatPeer chatPeer = maybeChatPeer diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesSettings.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesSettings.swift index aa4b951618..c94fa8ed06 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesSettings.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesSettings.swift @@ -85,6 +85,7 @@ public struct PresentationResourcesSettings { public static let balance = renderIcon(name: "Settings/Menu/Balance", scaleFactor: 0.97, backgroundColors: [UIColor(rgb: 0x34c759)]) public static let affiliateProgram = renderIcon(name: "Settings/Menu/AffiliateProgram") public static let earnStars = renderIcon(name: "Settings/Menu/EarnStars") + public static let channelMessages = renderIcon(name: "Chat/Info/ChannelMessages", backgroundColors: [UIColor(rgb: 0xFF9500)]) public static let premium = generateImage(CGSize(width: 29.0, height: 29.0), contextGenerator: { size, context in let bounds = CGRect(origin: CGPoint(), size: size) diff --git a/submodules/TelegramUI/Components/AsyncListComponent/Sources/AsyncListComponent.swift b/submodules/TelegramUI/Components/AsyncListComponent/Sources/AsyncListComponent.swift index 84052836fa..39f4764599 100644 --- a/submodules/TelegramUI/Components/AsyncListComponent/Sources/AsyncListComponent.swift +++ b/submodules/TelegramUI/Components/AsyncListComponent/Sources/AsyncListComponent.swift @@ -325,11 +325,16 @@ public final class AsyncListComponent: Component { } private final class ListItemNodeImpl: ListViewItemNode { + private let contentContainer: UIView private let contentsView = ComponentView() private(set) var item: ListItemImpl? init() { + self.contentContainer = UIView() + super.init(layerBacked: false, dynamicBounce: false, rotated: false, seeThrough: false) + + self.view.addSubview(self.contentContainer) } deinit { @@ -377,16 +382,17 @@ public final class AsyncListComponent: Component { switch item.direction { case .vertical: - self.layer.sublayerTransform = CATransform3DIdentity + self.contentContainer.layer.sublayerTransform = CATransform3DIdentity case .horizontal: - self.layer.sublayerTransform = CATransform3DMakeRotation(CGFloat.pi / 2.0, 0.0, 0.0, 1.0) + self.contentContainer.layer.sublayerTransform = CATransform3DMakeRotation(CGFloat.pi / 2.0, 0.0, 0.0, 1.0) } + self.contentContainer.frame = CGRect(origin: CGPoint(), size: mappedContentsSize) let contentsFrame = CGRect(origin: CGPoint(), size: contentsSize) if let contentsComponentView = self.contentsView.view { if contentsComponentView.superview == nil { - self.view.addSubview(contentsComponentView) + self.contentContainer.addSubview(contentsComponentView) } contentsComponentView.center = CGPoint(x: mappedContentsSize.width * 0.5, y: mappedContentsSize.height * 0.5) contentsComponentView.bounds = CGRect(origin: CGPoint(), size: contentsFrame.size) diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 0e207a473e..606d5edcdc 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -1033,7 +1033,7 @@ private func settingsItems(data: PeerInfoScreenData?, context: AccountContext, p } } if !isPremiumDisabled || context.isPremium { - items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 103, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.Settings_Business, icon: PresentationResourcesSettings.business, action: { + items[.payment]!.append(PeerInfoScreenDisclosureItem(id: 103, label: .text(""), additionalBadgeLabel: nil, text: presentationData.strings.Settings_Business, icon: PresentationResourcesSettings.business, action: { interaction.openSettings(.businessSetup) })) } @@ -2219,7 +2219,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt interaction.editingOpenDiscussionGroupSetup() })) - items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPostSuggestionsSettings, label: .text(channel.linkedMonoforumId == nil ? presentationData.strings.PeerInfo_AllowChannelMessages_Off : presentationData.strings.PeerInfo_AllowChannelMessages_On), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.PeerInfo_AllowChannelMessages, icon: UIImage(bundleImageName: "Chat/Info/PostSuggestionsIcon"), action: { + items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemPostSuggestionsSettings, label: .text(channel.linkedMonoforumId == nil ? presentationData.strings.PeerInfo_AllowChannelMessages_Off : presentationData.strings.PeerInfo_AllowChannelMessages_On), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.PeerInfo_AllowChannelMessages, icon: PresentationResourcesSettings.channelMessages, action: { interaction.editingOpenPostSuggestionsSetup() })) } @@ -2246,10 +2246,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt } else { label = "" } - var additionalBadgeLabel: String? = nil - if case .broadcast = channel.info { - additionalBadgeLabel = presentationData.strings.Settings_New - } + let additionalBadgeLabel: String? = nil items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemReactions, label: .text(label), additionalBadgeLabel: additionalBadgeLabel, text: presentationData.strings.PeerInfo_Reactions, icon: UIImage(bundleImageName: "Settings/Menu/Reactions"), action: { interaction.editingOpenReactionsSetup() })) @@ -2356,7 +2353,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt })) if channel.linkedMonoforumId != nil { - items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemChannelMessages, label: .none, text: presentationData.strings.PeerInfo_ChannelMessages, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: { + items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemChannelMessages, label: .none, text: presentationData.strings.PeerInfo_ChannelMessages, icon: PresentationResourcesSettings.channelMessages, action: { interaction.openChannelMessages() })) } @@ -2373,7 +2370,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt } if canJoinRefProgram { - items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemAffiliatePrograms, label: .text(""), additionalBadgeLabel: presentationData.strings.Settings_New, text: presentationData.strings.PeerInfo_ItemAffiliatePrograms_Title, icon: PresentationResourcesSettings.affiliateProgram, action: { + items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemAffiliatePrograms, label: .text(""), additionalBadgeLabel: nil, text: presentationData.strings.PeerInfo_ItemAffiliatePrograms_Title, icon: PresentationResourcesSettings.affiliateProgram, action: { interaction.editingOpenAffiliateProgram() })) } @@ -2529,7 +2526,8 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt if let approximateBoostLevel = channel.approximateBoostLevel, approximateBoostLevel < 1 { boostIcon = generateDisclosureActionBoostLevelBadgeImage(text: presentationData.strings.Channel_Info_BoostLevelPlusBadge("1").string) } else { - let labelText = NSAttributedString(string: presentationData.strings.Settings_New, font: Font.medium(11.0), textColor: presentationData.theme.list.itemCheckColors.foregroundColor) + boostIcon = nil + /*let labelText = NSAttributedString(string: presentationData.strings.Settings_New, font: Font.medium(11.0), textColor: presentationData.theme.list.itemCheckColors.foregroundColor) let labelBounds = labelText.boundingRect(with: CGSize(width: 100.0, height: 100.0), options: [.usesLineFragmentOrigin], context: nil) let labelSize = CGSize(width: ceil(labelBounds.width), height: ceil(labelBounds.height)) let badgeSize = CGSize(width: labelSize.width + 8.0, height: labelSize.height + 2.0 + 1.0) @@ -2545,7 +2543,7 @@ private func editingItems(data: PeerInfoScreenData?, boostStatus: ChannelBoostSt UIGraphicsPushContext(context) labelText.draw(at: CGPoint(x: 4.0, y: 1.0 + UIScreenPixel)) UIGraphicsPopContext() - }) + })*/ } items[.peerDataSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemAppearance, label: .image(colorImage, colorImage.size), additionalBadgeIcon: boostIcon, text: presentationData.strings.Channel_Info_AppearanceItem, icon: UIImage(bundleImageName: "Chat/Info/NameColorIcon"), action: { interaction.editingOpenNameColorSetup() diff --git a/submodules/TelegramUI/Components/PeerInfo/PostSuggestionsSettingsScreen/Sources/PostSuggestionsSettingsScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PostSuggestionsSettingsScreen/Sources/PostSuggestionsSettingsScreen.swift index 414dfda134..05ed5209f3 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PostSuggestionsSettingsScreen/Sources/PostSuggestionsSettingsScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PostSuggestionsSettingsScreen/Sources/PostSuggestionsSettingsScreen.swift @@ -230,7 +230,7 @@ final class PostSuggestionsSettingsScreenComponent: Component { let iconSize = self.icon.update( transition: .immediate, component: AnyComponent(LottieComponent( - content: LottieComponent.AppBundleContent(name: "LampEmoji"), + content: LottieComponent.AppBundleContent(name: "ChannelMessages"), loop: false )), environment: {}, diff --git a/submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/Contents.json similarity index 75% rename from submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/Contents.json rename to submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/Contents.json index a88c7d45f3..97986c3294 100644 --- a/submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "ic_discussion.pdf", + "filename" : "bubbles_30 (1).pdf", "idiom" : "universal" } ], diff --git a/submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/bubbles_30 (1).pdf b/submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/bubbles_30 (1).pdf new file mode 100644 index 0000000000..8461becec8 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat/Info/ChannelMessages.imageset/bubbles_30 (1).pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/ic_discussion.pdf b/submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/ic_discussion.pdf deleted file mode 100644 index ab7bf2f754..0000000000 Binary files a/submodules/TelegramUI/Images.xcassets/Chat/Info/PostSuggestionsIcon.imageset/ic_discussion.pdf and /dev/null differ diff --git a/submodules/TelegramUI/Resources/Animations/ChannelMessages.tgs b/submodules/TelegramUI/Resources/Animations/ChannelMessages.tgs new file mode 100644 index 0000000000..3a0806e1ae Binary files /dev/null and b/submodules/TelegramUI/Resources/Animations/ChannelMessages.tgs differ diff --git a/submodules/TelegramUI/Resources/Animations/LampEmoji.tgs b/submodules/TelegramUI/Resources/Animations/LampEmoji.tgs deleted file mode 100644 index e3c35414ad..0000000000 Binary files a/submodules/TelegramUI/Resources/Animations/LampEmoji.tgs and /dev/null differ