diff --git a/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/AdminUserActionsSheet.swift b/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/AdminUserActionsSheet.swift index 2a042c2b4c..584b12f197 100644 --- a/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/AdminUserActionsSheet.swift +++ b/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/AdminUserActionsSheet.swift @@ -527,8 +527,7 @@ private final class AdminUserActionsSheetComponent: Component { break loop case let .member(_, _, adminInfo, banInfo, _): if adminInfo != nil { - allowedParticipantRights = [] - allowedMediaRights = [] + (allowedParticipantRights, allowedMediaRights) = rightsFromBannedRights([]) break loop } else if let banInfo { (peerParticipantRights, peerMediaRights) = rightsFromBannedRights(banInfo.rights.flags) @@ -825,6 +824,7 @@ private final class AdminUserActionsSheetComponent: Component { context: component.context, theme: environment.theme, strings: environment.strings, + baseFontSize: presentationData.listsFontSize.baseDisplaySize, sideInset: 0.0, title: EnginePeer(peer.peer).displayTitle(strings: environment.strings, displayOrder: .firstLast), peer: EnginePeer(peer.peer), @@ -1102,6 +1102,7 @@ private final class AdminUserActionsSheetComponent: Component { guard let self else { return } + switch configItem { case .sendMessages: if self.participantRights.contains(.sendMessages) { @@ -1137,12 +1138,20 @@ private final class AdminUserActionsSheetComponent: Component { self.state?.updated(transition: .spring(duration: 0.35)) } : nil )), - action: (isEnabled && configItem == .sendMedia) ? { [weak self] _ in - guard let self else { + action: ((isEnabled && configItem == .sendMedia) || !isEnabled) ? { [weak self] _ in + guard let self, let component = self.component else { return } - self.isMediaSectionExpanded = !self.isMediaSectionExpanded - self.state?.updated(transition: .spring(duration: 0.35)) + if !isEnabled { + let presentationData = component.context.sharedContext.currentPresentationData.with { $0 } + self.environment?.controller()?.present(standardTextAlertController(theme: AlertControllerTheme(presentationData: presentationData), title: nil, text: environment.strings.GroupPermission_PermissionDisabledByDefault, actions: [ + TextAlertAction(type: .defaultAction, title: environment.strings.Common_OK, action: { + }) + ]), in: .window(.root)) + } else { + self.isMediaSectionExpanded = !self.isMediaSectionExpanded + self.state?.updated(transition: .spring(duration: 0.35)) + } } : nil, highlighting: .disabled )))) @@ -1756,4 +1765,3 @@ private final class OptionsSectionFooterComponent: Component { return view.update(component: self, availableSize: availableSize, state: state, environment: environment, transition: transition) } } - diff --git a/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/RecentActionsSettingsSheet.swift b/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/RecentActionsSettingsSheet.swift index 24df544b7f..9c0f4d973d 100644 --- a/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/RecentActionsSettingsSheet.swift +++ b/submodules/TelegramUI/Components/AdminUserActionsSheet/Sources/RecentActionsSettingsSheet.swift @@ -759,6 +759,7 @@ private final class RecentActionsSettingsSheetComponent: Component { context: component.context, theme: environment.theme, strings: environment.strings, + baseFontSize: presentationData.listsFontSize.baseDisplaySize, sideInset: 0.0, title: peer.displayTitle(strings: environment.strings, displayOrder: .firstLast), peer: peer, diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/Panes/PeerInfoMembersPane.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/Panes/PeerInfoMembersPane.swift index b4cf661eab..4383cb8e8c 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/Panes/PeerInfoMembersPane.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/Panes/PeerInfoMembersPane.swift @@ -141,7 +141,7 @@ private enum PeerMembersListEntry: Comparable, Identifiable { sortOrder: presentationData.nameSortOrder, displayOrder: presentationData.nameDisplayOrder, context: context, - peerMode: .peer, + peerMode: .memberList, peer: .peer(peer: EnginePeer(member.peer), chatPeer: EnginePeer(member.peer)), status: .presence(presence, presentationData.dateTimeFormat), rightLabelText: label, @@ -153,7 +153,7 @@ private enum PeerMembersListEntry: Comparable, Identifiable { actionIcon: .none, index: nil, header: nil, - action: { _ in + action: member.peer.id == context.account.peerId ? nil : { _ in action(member, .open) }, disabledAction: nil,