diff --git a/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift b/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift index 1e05478f0f..066a127e4c 100644 --- a/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelAdminsController.swift @@ -349,7 +349,7 @@ private func channelAdminsControllerEntries(presentationData: PresentationData, if case .group = peer.info { isGroup = true } - entries.append(.recentActions(presentationData.theme, presentationData.strings.Group_Info_AdminLog)) + //entries.append(.recentActions(presentationData.theme, presentationData.strings.Group_Info_AdminLog)) if isGroup && peer.hasPermission(.deleteAllMessages) && (antiSpamAvailable || antiSpamEnabled) { entries.append(.antiSpam(presentationData.theme, presentationData.strings.Group_Management_AntiSpam, antiSpamEnabled)) diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift index f5c09d23b4..8fcbad3449 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift @@ -514,6 +514,7 @@ private final class PeerInfoInteraction { let editingOpenDiscussionGroupSetup: () -> Void let editingToggleMessageSignatures: (Bool) -> Void let openParticipantsSection: (PeerInfoParticipantsSection) -> Void + let openRecentActions: () -> Void let editingOpenPreHistorySetup: () -> Void let editingOpenAutoremoveMesages: () -> Void let openPermissions: () -> Void @@ -564,6 +565,7 @@ private final class PeerInfoInteraction { editingOpenDiscussionGroupSetup: @escaping () -> Void, editingToggleMessageSignatures: @escaping (Bool) -> Void, openParticipantsSection: @escaping (PeerInfoParticipantsSection) -> Void, + openRecentActions: @escaping () -> Void, editingOpenPreHistorySetup: @escaping () -> Void, editingOpenAutoremoveMesages: @escaping () -> Void, openPermissions: @escaping () -> Void, @@ -613,6 +615,7 @@ private final class PeerInfoInteraction { self.editingOpenDiscussionGroupSetup = editingOpenDiscussionGroupSetup self.editingToggleMessageSignatures = editingToggleMessageSignatures self.openParticipantsSection = openParticipantsSection + self.openRecentActions = openRecentActions self.editingOpenPreHistorySetup = editingOpenPreHistorySetup self.editingOpenAutoremoveMesages = editingOpenAutoremoveMesages self.openPermissions = openPermissions @@ -1486,6 +1489,7 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL let ItemMembers = 9 let ItemMemberRequests = 10 let ItemBanned = 11 + let ItemRecentActions = 12 let isCreator = channel.flags.contains(.isCreator) @@ -1602,6 +1606,10 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemBanned, label: .text("\(bannedCount == 0 ? "" : "\(presentationStringsFormattedNumber(bannedCount, presentationData.dateTimeFormat.groupingSeparator))")"), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: { interaction.openParticipantsSection(.banned) })) + + items[.peerAdditionalSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRecentActions, label: .none, text: presentationData.strings.Group_Info_AdminLog, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: { + interaction.openRecentActions() + })) } } @@ -1621,13 +1629,14 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL let ItemAdmins = 108 let ItemMemberRequests = 109 let ItemRemovedUsers = 110 - let ItemLocationHeader = 111 - let ItemLocation = 112 - let ItemLocationSetup = 113 - let ItemDeleteGroup = 114 - let ItemReactions = 115 - let ItemTopics = 116 - let ItemTopicsText = 117 + let ItemRecentActions = 111 + let ItemLocationHeader = 112 + let ItemLocation = 113 + let ItemLocationSetup = 114 + let ItemDeleteGroup = 115 + let ItemReactions = 116 + let ItemTopics = 117 + let ItemTopicsText = 118 let isCreator = channel.flags.contains(.isCreator) let isPublic = channel.addressName != nil @@ -1832,6 +1841,10 @@ private func editingItems(data: PeerInfoScreenData?, state: PeerInfoState, chatL items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRemovedUsers, label: .text(cachedData.participantsSummary.kickedCount.flatMap { $0 > 0 ? "\(presentationStringsFormattedNumber($0, presentationData.dateTimeFormat.groupingSeparator))" : "" } ?? ""), text: presentationData.strings.GroupInfo_Permissions_Removed, icon: UIImage(bundleImageName: "Chat/Info/GroupRemovedIcon"), action: { interaction.openParticipantsSection(.banned) })) + + items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemRecentActions, label: .none, text: presentationData.strings.Group_Info_AdminLog, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: { + interaction.openRecentActions() + })) } if isCreator { @@ -2207,6 +2220,9 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate openParticipantsSection: { [weak self] section in self?.openParticipantsSection(section: section) }, + openRecentActions: { [weak self] in + self?.openRecentActions() + }, editingOpenPreHistorySetup: { [weak self] in self?.editingOpenPreHistorySetup() }, @@ -6726,6 +6742,14 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate } } + private func openRecentActions() { + guard let peer = self.data?.peer else { + return + } + let controller = self.context.sharedContext.makeChatRecentActionsController(context: self.context, peer: peer, adminPeerId: nil) + self.controller?.push(controller) + } + private func editingOpenPreHistorySetup() { guard let data = self.data, let peer = data.peer else { return