Files
mattermost-mobile/ios/patches/SessionDelegate.patch
Elias Nahum 088aa193ab [Gekidou] Use localPath when available (#6058)
* Use localPath when available

* Revert changes to replace space for dash in the filename

* Rename other action to external and always call onDownloadSuccess if defined

* add missing localization strings
2022-03-17 08:58:49 -03:00

20 lines
901 B
Diff

--- SessionDelegate.swift.orig 2022-03-12 17:34:07.000000000 -0300
+++ SessionDelegate.swift 2022-03-16 15:51:22.000000000 -0300
@@ -292,6 +292,16 @@
return
}
+ let allHeaders = (downloadRequest.response)?.allHeaderFields as? NSDictionary ?? NSDictionary()
+ let sizeString = (allHeaders["X-Uncompressed-Content-Length"] ?? allHeaders["x-uncompressed-content-length"]) as? String
+ if (sizeString != nil) {
+ let size = Int64(sizeString!)
+ downloadRequest.updateDownloadProgress(bytesWritten: bytesWritten,
+ totalBytesExpectedToWrite: size!)
+ return
+
+ }
+
downloadRequest.updateDownloadProgress(bytesWritten: bytesWritten,
totalBytesExpectedToWrite: totalBytesExpectedToWrite)
}