mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Will need to support progressive sizes in the future
This commit is contained in:
parent
0d9c4aafe7
commit
d2036b830e
@ -248,6 +248,7 @@ static void reportMemory() {
|
|||||||
|
|
||||||
int32_t fileDatacenterId = 0;
|
int32_t fileDatacenterId = 0;
|
||||||
Api1_InputFileLocation *inputFileLocation = nil;
|
Api1_InputFileLocation *inputFileLocation = nil;
|
||||||
|
int32_t progressiveFileLimit = -1;
|
||||||
|
|
||||||
NSString *fetchResourceId = nil;
|
NSString *fetchResourceId = nil;
|
||||||
bool isPng = false;
|
bool isPng = false;
|
||||||
@ -257,14 +258,27 @@ static void reportMemory() {
|
|||||||
if ([parsedAttachment isKindOfClass:[Api1_Photo_photo class]]) {
|
if ([parsedAttachment isKindOfClass:[Api1_Photo_photo class]]) {
|
||||||
Api1_Photo_photo *photo = parsedAttachment;
|
Api1_Photo_photo *photo = parsedAttachment;
|
||||||
isExpandableMedia = true;
|
isExpandableMedia = true;
|
||||||
for (id size in photo.sizes) {
|
|
||||||
if ([size isKindOfClass:[Api1_PhotoSize_photoSize class]]) {
|
/*for (id size in photo.sizes) {
|
||||||
Api1_PhotoSize_photoSize *sizeValue = size;
|
if ([size isKindOfClass:[Api1_PhotoSize_photoSizeProgressive class]]) {
|
||||||
if ([sizeValue.type isEqualToString:@"m"]) {
|
Api1_PhotoSize_photoSizeProgressive *sizeValue = size;
|
||||||
inputFileLocation = [Api1_InputFileLocation inputPhotoFileLocationWithPid:photo.pid accessHash:photo.accessHash fileReference:photo.fileReference thumbSize:sizeValue.type];
|
inputFileLocation = [Api1_InputFileLocation inputPhotoFileLocationWithPid:photo.pid accessHash:photo.accessHash fileReference:photo.fileReference thumbSize:sizeValue.type];
|
||||||
fileDatacenterId = [photo.dcId intValue];
|
fileDatacenterId = [photo.dcId intValue];
|
||||||
fetchResourceId = [NSString stringWithFormat:@"telegram-cloud-photo-size-%@-%@-%@", photo.dcId, photo.pid, sizeValue.type];
|
fetchResourceId = [NSString stringWithFormat:@"telegram-cloud-photo-size-%@-%@-%@", photo.dcId, photo.pid, sizeValue.type];
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (inputFileLocation == nil) {
|
||||||
|
for (id size in photo.sizes) {
|
||||||
|
if ([size isKindOfClass:[Api1_PhotoSize_photoSize class]]) {
|
||||||
|
Api1_PhotoSize_photoSize *sizeValue = size;
|
||||||
|
if ([sizeValue.type isEqualToString:@"m"]) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user