Browse Source

Fix (removed 1000) on timeIntervalSince1970

Marino Faggiana 7 years ago
parent
commit
7262b08f74
2 changed files with 7 additions and 6 deletions
  1. 7 5
      iOSClient/Networking/CCNetworking.m
  2. 0 1
      iOSClient/Security/NCClientEncryption.m

+ 7 - 5
iOSClient/Networking/CCNetworking.m

@@ -1014,11 +1014,13 @@
     [request setValue:authValue forHTTPHeaderField:@"Authorization"];
     
     // Change date file upload with header : X-OC-Mtime (ctime assetLocalIdentifier)
-    PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetLocalIdentifier] options:nil];
-    if (result.count) {
-        asset = result[0];
-        long dateFileCreation = [asset.creationDate timeIntervalSince1970] * 1000;
-        [request setValue:[NSString stringWithFormat:@"%ld", dateFileCreation] forHTTPHeaderField:@"X-OC-Mtime"];
+    if (assetLocalIdentifier) {
+        PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[assetLocalIdentifier] options:nil];
+        if (result.count) {
+            asset = result[0];
+            long dateFileCreation = [asset.creationDate timeIntervalSince1970];
+            [request setValue:[NSString stringWithFormat:@"%ld", dateFileCreation] forHTTPHeaderField:@"X-OC-Mtime"];
+        }
     }
     
     // Rename with the SessionID

+ 0 - 1
iOSClient/Security/NCClientEncryption.m

@@ -27,7 +27,6 @@
 #import <CommonCrypto/CommonCryptor.h>
 #import <CommonCrypto/CommonDigest.h>
 #import <Security/Security.h>
-#import "CommonCryptorSPI.h"
 
 #import <openssl/x509.h>
 #import <openssl/bio.h>