mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various improvements
This commit is contained in:
parent
f2e96efdb5
commit
4513f7d2e4
6 changed files with 118 additions and 19 deletions
|
|
@ -1512,14 +1512,23 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
|||
}
|
||||
|
||||
if let message = messages.first, message.id.namespace == Namespaces.Message.Cloud, let channel = message.peers[message.id.peerId] as? TelegramChannel, channel.isMonoForum {
|
||||
//TODO:localize
|
||||
actions.append(.action(ContextMenuActionItem(text: "Suggest a Post", icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Customize"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { c, _ in
|
||||
c?.dismiss(completion: {
|
||||
interfaceInteraction.openSuggestPost(message)
|
||||
})
|
||||
})))
|
||||
var canSuggestPost = true
|
||||
for media in message.media {
|
||||
if media is TelegramMediaAction {
|
||||
canSuggestPost = false
|
||||
}
|
||||
}
|
||||
|
||||
if canSuggestPost {
|
||||
//TODO:localize
|
||||
actions.append(.action(ContextMenuActionItem(text: "Suggest a Post", icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Customize"), color: theme.actionSheet.primaryTextColor)
|
||||
}, action: { c, _ in
|
||||
c?.dismiss(completion: {
|
||||
interfaceInteraction.openSuggestPost(message)
|
||||
})
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
||||
if let activePoll = activePoll, let voters = activePoll.results.voters {
|
||||
|
|
@ -1935,6 +1944,11 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
|
|||
if let channel = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramChannel, channel.isMonoForum, let associatedPeerId = channel.associatedPeerId {
|
||||
if message.effectivelyIncoming(context.account.peerId), message.author?.id == associatedPeerId {
|
||||
canViewAuthor = true
|
||||
for media in message.media {
|
||||
if media is TelegramMediaAction {
|
||||
canViewAuthor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if let messageReadStatsAreHidden = infoSummaryData.messageReadStatsAreHidden, !messageReadStatsAreHidden {
|
||||
canViewStats = canViewReadStats(message: message, participantCount: infoSummaryData.participantCount, isMessageRead: isMessageRead, isPremium: isPremium, appConfig: appConfig)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue