mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Various fixes
This commit is contained in:
@@ -159,17 +159,18 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState
|
||||
}
|
||||
|
||||
if channel.flags.contains(.isForum) && isMember {
|
||||
var canManage = false
|
||||
if channel.flags.contains(.isCreator) {
|
||||
canManage = true
|
||||
} else if channel.hasPermission(.manageTopics) {
|
||||
canManage = true
|
||||
}
|
||||
|
||||
if let threadData = chatPresentationInterfaceState.threadData {
|
||||
if threadData.isClosed {
|
||||
var canManage = false
|
||||
if channel.flags.contains(.isCreator) {
|
||||
canManage = true
|
||||
} else if channel.hasPermission(.manageTopics) {
|
||||
canManage = true
|
||||
} else if threadData.isOwnedByMe {
|
||||
if threadData.isOwnedByMe {
|
||||
canManage = true
|
||||
}
|
||||
|
||||
if !canManage {
|
||||
if let currentPanel = (currentPanel as? ChatRestrictedInputPanelNode) ?? (currentSecondaryPanel as? ChatRestrictedInputPanelNode) {
|
||||
return (currentPanel, nil)
|
||||
@@ -181,6 +182,17 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if let isGeneralThreadClosed = chatPresentationInterfaceState.isGeneralThreadClosed, isGeneralThreadClosed {
|
||||
if !canManage {
|
||||
if let currentPanel = (currentPanel as? ChatRestrictedInputPanelNode) ?? (currentSecondaryPanel as? ChatRestrictedInputPanelNode) {
|
||||
return (currentPanel, nil)
|
||||
} else {
|
||||
let panel = ChatRestrictedInputPanelNode()
|
||||
panel.context = context
|
||||
panel.interfaceInteraction = interfaceInteraction
|
||||
return (panel, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user