mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-07 16:11:13 +00:00
Allow everyone to post polls
This commit is contained in:
parent
7663fc2012
commit
d6a734730c
@ -101,28 +101,7 @@ func legacyAttachmentMenu(account: Account, peer: Peer, editMediaOptions: Messag
|
||||
})!
|
||||
itemViews.append(locationItem)
|
||||
|
||||
var canPin = false
|
||||
if let channel = peer as? TelegramChannel {
|
||||
switch channel.info {
|
||||
case .broadcast:
|
||||
canPin = channel.hasAdminRights([.canEditMessages])
|
||||
case .group:
|
||||
canPin = channel.hasAdminRights([.canPinMessages])
|
||||
}
|
||||
} else if let group = peer as? TelegramGroup {
|
||||
if group.flags.contains(.adminsEnabled) {
|
||||
switch group.role {
|
||||
case .creator, .admin:
|
||||
canPin = true
|
||||
default:
|
||||
canPin = false
|
||||
}
|
||||
} else {
|
||||
canPin = true
|
||||
}
|
||||
}
|
||||
|
||||
if canPin {
|
||||
if !(peer is TelegramSecretChat) && canSendMessagesToPeer(peer) {
|
||||
let pollItem = TGMenuSheetButtonItemView(title: strings.AttachmentMenu_Poll, type: TGMenuSheetButtonTypeDefault, action: { [weak controller] in
|
||||
controller?.dismiss(animated: true)
|
||||
openPoll()
|
||||
|
Loading…
x
Reference in New Issue
Block a user