diff --git a/TelegramCore/ChatHistoryPreloadManager.swift b/TelegramCore/ChatHistoryPreloadManager.swift index 6f4a2920a7..f3095a4ddd 100644 --- a/TelegramCore/ChatHistoryPreloadManager.swift +++ b/TelegramCore/ChatHistoryPreloadManager.swift @@ -276,8 +276,6 @@ final class ChatHistoryPreloadManager { switch index.entity { case let .peer(peerId): key = .messageOfInterestHole(location: .peer(peerId), namespace: Namespaces.Message.Cloud, count: 60) - /*case let .group(groupId): - key = .messageOfInterestHole(location: .group(groupId), namespace: Namespaces.Message.Cloud, count: 60)*/ } view.disposable.set((self.postbox.combinedView(keys: [key]) |> deliverOn(self.queue)).start(next: { [weak self] next in diff --git a/TelegramCore/CloudFileMediaResource.swift b/TelegramCore/CloudFileMediaResource.swift index 7f0cf5770f..612b332703 100644 --- a/TelegramCore/CloudFileMediaResource.swift +++ b/TelegramCore/CloudFileMediaResource.swift @@ -464,11 +464,7 @@ public class CloudDocumentMediaResource: TelegramCloudMediaResource, TelegramMul } func apiInputLocation(fileReference: Data?) -> Api.InputFileLocation? { - if let fileReference = fileReference { - return Api.InputFileLocation.inputDocumentFileLocation(id: self.fileId, accessHash: self.accessHash, fileReference: Buffer(data: fileReference), thumbSize: "") - } else { - return nil - } + return Api.InputFileLocation.inputDocumentFileLocation(id: self.fileId, accessHash: self.accessHash, fileReference: Buffer(data: fileReference ?? Data()), thumbSize: "") } public init(datacenterId: Int, fileId: Int64, accessHash: Int64, size: Int?, fileReference: Data?, fileName: String?) {