Rollback some changes

This commit is contained in:
Ilya Laktyushin 2020-10-08 22:09:15 +04:00
parent 8aee2109df
commit 92c71c8d8d
2 changed files with 2 additions and 33 deletions

View File

@ -7039,21 +7039,6 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
if let strongSelf = self {
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] = []
for item in results {
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 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)
}
}

View File

@ -809,22 +809,6 @@ func contextMenuForChatPresentationIntefaceState(chatPresentationInterfaceState:
var clearCacheAsDelete = false
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
}