mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Revert "Rollback some changes"
This reverts commit 92c71c8d8dc1704417c9592aaa037359544f9996.
This commit is contained in:
parent
fffa91afe2
commit
d8c66309fa
@ -7039,6 +7039,21 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let replyMessageId = strongSelf.presentationInterfaceState.interfaceState.replyMessageId
|
let replyMessageId = strongSelf.presentationInterfaceState.interfaceState.replyMessageId
|
||||||
|
|
||||||
|
var groupingKey: Int64?
|
||||||
|
var allItemsAreAudio = true
|
||||||
|
for item in results {
|
||||||
|
if let item = item {
|
||||||
|
let pathExtension = (item.fileName as NSString).pathExtension.lowercased()
|
||||||
|
if !["mp3", "m4a"].contains(pathExtension) {
|
||||||
|
allItemsAreAudio = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if allItemsAreAudio {
|
||||||
|
groupingKey = arc4random64()
|
||||||
|
}
|
||||||
|
|
||||||
var messages: [EnqueueMessage] = []
|
var messages: [EnqueueMessage] = []
|
||||||
for item in results {
|
for item in results {
|
||||||
if let item = item {
|
if let item = item {
|
||||||
@ -7055,7 +7070,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
|
|
||||||
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: fileId), partialReference: nil, resource: ICloudFileResource(urlData: item.urlData, thumbnail: false), previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: mimeType, size: item.fileSize, attributes: attributes)
|
let file = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: fileId), partialReference: nil, resource: ICloudFileResource(urlData: item.urlData, thumbnail: false), previewRepresentations: previewRepresentations, videoThumbnails: [], immediateThumbnailData: nil, mimeType: mimeType, size: item.fileSize, attributes: attributes)
|
||||||
let message: EnqueueMessage = .message(text: "", attributes: [], mediaReference: .standalone(media: file), replyToMessageId: replyMessageId, localGroupingKey: nil)
|
let message: EnqueueMessage = .message(text: "", attributes: [], mediaReference: .standalone(media: file), replyToMessageId: replyMessageId, localGroupingKey: groupingKey)
|
||||||
messages.append(message)
|
messages.append(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,6 +809,22 @@ func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState:
|
|||||||
|
|
||||||
var clearCacheAsDelete = false
|
var clearCacheAsDelete = false
|
||||||
if message.id.peerId.namespace == Namespaces.Peer.CloudChannel {
|
if message.id.peerId.namespace == Namespaces.Peer.CloudChannel {
|
||||||
|
var views: Int = 0
|
||||||
|
for attribute in message.attributes {
|
||||||
|
if let attribute = attribute as? ViewCountMessageAttribute {
|
||||||
|
views = attribute.count
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if 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
|
||||||
|
c.dismiss(completion: {
|
||||||
|
controllerInteraction.openMessageStats(messages[0].id)
|
||||||
|
})
|
||||||
|
})))
|
||||||
|
}
|
||||||
|
|
||||||
clearCacheAsDelete = true
|
clearCacheAsDelete = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user