Refactor Recent Actions button

This commit is contained in:
Kylmakalle 2025-03-22 21:24:29 +02:00
parent 328af4c1f5
commit 69740f504a

View File

@ -1757,6 +1757,7 @@ private func infoItems(nearestChatParticipant: (String?, Int32?), showProfileId:
let ItemMemberRequests = 8
let ItemBalance = 9
let ItemEdit = 10
let ItemSGRecentActions = 11
if let _ = data.threadData {
let mainUsername: String
@ -1993,6 +1994,14 @@ private func infoItems(nearestChatParticipant: (String?, Int32?), showProfileId:
items[section]!.append(PeerInfoScreenDisclosureItem(id: ItemEdit, label: .none, text: settingsTitle, icon: UIImage(bundleImageName: "Chat/Info/SettingsIcon"), action: {
interaction.openEditing()
}))
// MARK: Swiftgram
if channel.hasPermission(.banMembers) || channel.flags.contains(.isCreator) {
items[section]!.append(PeerInfoScreenDisclosureItem(id: ItemSGRecentActions, label: .none, text: presentationData.strings.Group_Info_AdminLog, icon: UIImage(bundleImageName: "Chat/Info/RecentActionsIcon"), action: {
interaction.openRecentActions()
}))
}
//
}
}
}
@ -6917,14 +6926,6 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
})))
// MARK: Swiftgram
} else {
items.append(.action(ContextMenuActionItem(text: presentationData.strings.Group_Info_AdminLog, icon: { theme in
generateTintedImage(image: UIImage(bundleImageName: "Peer Info/RefProgram/IntroListEye"), color: theme.contextMenu.primaryColor)
}, action: { [weak self] c, f in
f(.dismissWithoutContent)
self?.openRecentActions()
})))
}
if case .group = channel.info {
items.append(.action(ContextMenuActionItem(text: presentationData.strings.GroupInfo_Administrators, icon: { theme in
generateTintedImage(image: UIImage(bundleImageName: "Chat List/ProxyShieldIcon"), color: theme.contextMenu.primaryColor)