Will need to support progressive sizes in the future

This commit is contained in:
Ali 2021-02-19 20:37:57 +04:00
parent 0d9c4aafe7
commit d2036b830e

View File

@ -248,6 +248,7 @@ static void reportMemory() {
int32_t fileDatacenterId = 0;
Api1_InputFileLocation *inputFileLocation = nil;
int32_t progressiveFileLimit = -1;
NSString *fetchResourceId = nil;
bool isPng = false;
@ -257,6 +258,18 @@ static void reportMemory() {
if ([parsedAttachment isKindOfClass:[Api1_Photo_photo class]]) {
Api1_Photo_photo *photo = parsedAttachment;
isExpandableMedia = true;
/*for (id size in photo.sizes) {
if ([size isKindOfClass:[Api1_PhotoSize_photoSizeProgressive class]]) {
Api1_PhotoSize_photoSizeProgressive *sizeValue = size;
inputFileLocation = [Api1_InputFileLocation inputPhotoFileLocationWithPid:photo.pid accessHash:photo.accessHash fileReference:photo.fileReference thumbSize:sizeValue.type];
fileDatacenterId = [photo.dcId intValue];
fetchResourceId = [NSString stringWithFormat:@"telegram-cloud-photo-size-%@-%@-%@", photo.dcId, photo.pid, sizeValue.type];
break;
}
}*/
if (inputFileLocation == nil) {
for (id size in photo.sizes) {
if ([size isKindOfClass:[Api1_PhotoSize_photoSize class]]) {
Api1_PhotoSize_photoSize *sizeValue = size;
@ -268,6 +281,7 @@ static void reportMemory() {
}
}
}
}
} else if ([parsedAttachment isKindOfClass:[Api1_Document_document class]]) {
Api1_Document_document *document = parsedAttachment;