Permission management updates

This commit is contained in:
Peter
2019-01-03 19:52:46 +01:00
parent d81b5b8950
commit 71385c916f
34 changed files with 2248 additions and 2237 deletions

View File

@@ -99,7 +99,7 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState
break
}
} else if let channel = peer as? TelegramChannel {
if let bannedRights = channel.bannedRights, bannedRights.flags.contains(.banSendMessages) {
if channel.hasBannedPermission(.banSendMessages) != nil {
if let currentPanel = currentPanel as? ChatRestrictedInputPanelNode {
return currentPanel
} else {
@@ -164,6 +164,17 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState
case .Member:
break
}
if group.hasBannedPermission(.banSendMessages) {
if let currentPanel = currentPanel as? ChatRestrictedInputPanelNode {
return currentPanel
} else {
let panel = ChatRestrictedInputPanelNode()
panel.account = account
panel.interfaceInteraction = interfaceInteraction
return panel
}
}
}
var displayBotStartPanel = false