forked from Ivasoft/mattermost-mobile
* 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
20 lines
901 B
Diff
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)
|
|
}
|