mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Show message stats options if message has forwards
This commit is contained in:
parent
ff306b0f89
commit
75c8295759
1 changed files with 5 additions and 1 deletions
|
|
@ -1692,13 +1692,17 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
|||
var clearCacheAsDelete = false
|
||||
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info, !isMigrated {
|
||||
var views: Int = 0
|
||||
var forwards: Int = 0
|
||||
for attribute in message.attributes {
|
||||
if let attribute = attribute as? ViewCountMessageAttribute {
|
||||
views = attribute.count
|
||||
}
|
||||
if let attribute = attribute as? ForwardCountMessageAttribute {
|
||||
forwards = attribute.count
|
||||
}
|
||||
}
|
||||
|
||||
if infoSummaryData.canViewStats, views >= 100 {
|
||||
if infoSummaryData.canViewStats, forwards >= 1 || views >= 100 {
|
||||
actions.append(.action(ContextMenuActionItem(text: chatPresentationInterfaceState.strings.Conversation_ContextViewStats, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Statistics"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { c, _ in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue