mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Merge commit '92c71c8d8dc1704417c9592aaa037359544f9996' into beta
This commit is contained in:
commit
f095446e81
@ -7038,22 +7038,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
|> deliverOnMainQueue).start(next: { results in
|
|> deliverOnMainQueue).start(next: { results in
|
||||||
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 {
|
||||||
@ -7070,7 +7055,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: groupingKey)
|
let message: EnqueueMessage = .message(text: "", attributes: [], mediaReference: .standalone(media: file), replyToMessageId: replyMessageId, localGroupingKey: nil)
|
||||||
messages.append(message)
|
messages.append(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,22 +809,6 @@ 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