marinofaggiana 4 роки тому
батько
коміт
b2cccedbbe

+ 2 - 2
Cartfile.resolved

@@ -8,7 +8,7 @@ github "SwiftyJSON/SwiftyJSON" "5.0.0"
 github "WeTransfer/WeScan" "1.2.0"
 github "WenchaoD/FSCalendar" "2.8.0"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
-github "getsentry/sentry-cocoa" "5.1.2"
+github "getsentry/sentry-cocoa" "5.1.4"
 github "huri000/QuickLayout" "3.0.0"
 github "huri000/SwiftEntryKit" "1.2.3"
 github "ivanbruel/MarkdownKit" "1.6"
@@ -20,7 +20,7 @@ github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/KTVHTTPCache" "2.0.2"
 github "marinofaggiana/TOPasscodeViewController" "0.0.6"
 github "marinofaggiana/XLForm" "eb9381ad8129f60402bf412250fb31b95a628a08"
-github "nextcloud/ios-communication-library" "4ae73a504e793ec9856daefef4415488fb35dd0f"
+github "nextcloud/ios-communication-library" "78433e184af02d01f25b6b6fc355492a4e0a93cc"
 github "realm/realm-cocoa" "v4.4.1"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.5"

+ 0 - 8
Nextcloud.xcodeproj/project.pbxproj

@@ -136,8 +136,6 @@
 		F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
 		F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72D404823D2082500A97FD0 /* NCViewerNextcloudText.swift */; };
 		F72E0B9D21AD60BC00898D7B /* WeScan.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F72E0B9C21AD60BC00898D7B /* WeScan.framework */; };
-		F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
-		F732BA0B1D76DBA500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F733B65221997CC2001C1FFA /* TLPhotoPicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F733B65121997CC1001C1FFA /* TLPhotoPicker.framework */; };
 		F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7362A1E220C853A005101B5 /* LaunchScreen.storyboard */; };
 		F738143A240FE48D00404AC7 /* NCViewerImageCommon.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7381439240FE48D00404AC7 /* NCViewerImageCommon.swift */; };
@@ -547,8 +545,6 @@
 		F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+TruncateToWidth.m"; sourceTree = "<group>"; };
 		F7320934201B812F008A0888 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F732093B201B81E4008A0888 /* es-419 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-419"; path = "es-419.lproj/Localizable.strings"; sourceTree = "<group>"; };
-		F732BA031D76CE1500E9878B /* CCNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNetworking.h; sourceTree = "<group>"; };
-		F732BA041D76CE1500E9878B /* CCNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNetworking.m; sourceTree = "<group>"; };
 		F733B65121997CC1001C1FFA /* TLPhotoPicker.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TLPhotoPicker.framework; path = Carthage/Build/iOS/TLPhotoPicker.framework; sourceTree = "<group>"; };
 		F7362A1E220C853A005101B5 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
 		F736B551234DCF57008A5C9F /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/iOS/Alamofire.framework; sourceTree = "<group>"; };
@@ -1170,8 +1166,6 @@
 				F7D96FCB246ED7E100536D73 /* NCNetworkingCheckRemoteUser.swift */,
 				F785EE9C246196DF00B3F945 /* NCNetworkingE2EE.swift */,
 				F75B0ABC244C4DBB00E58DCA /* NCNetworkingNotificationCenter.swift */,
-				F732BA031D76CE1500E9878B /* CCNetworking.h */,
-				F732BA041D76CE1500E9878B /* CCNetworking.m */,
 				F74D3DBD1BAC1941000BAE4B /* OCNetworking.h */,
 				F74D3DBE1BAC1941000BAE4B /* OCNetworking.m */,
 			);
@@ -2173,7 +2167,6 @@
 				F711CCC7246AC99E0009B204 /* NCXMLListParser.m in Sources */,
 				F711CCD9246AC99E0009B204 /* NSDate+RFC1123.m in Sources */,
 				F7F8D71C1ED6183000E711F3 /* CCCellShareExt.m in Sources */,
-				F732BA0B1D76DBA500E9878B /* CCNetworking.m in Sources */,
 				F71459E11D12E3B700CAFEEC /* CCHud.m in Sources */,
 				F711CCC1246AC99E0009B204 /* OCRichObjectStrings.m in Sources */,
 				F711CCB9246AC99E0009B204 /* OCUserProfile.m in Sources */,
@@ -2249,7 +2242,6 @@
 				F79018B8240962C7007C9B6D /* NCViewerImageViewController.swift in Sources */,
 				F769454022E9F077000A798A /* NCSharePaging.swift in Sources */,
 				F711CCDC246AC99E0009B204 /* OCSharedDto.m in Sources */,
-				F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */,
 				F78ACD4221903CE00088454D /* NCListCell.swift in Sources */,
 				F76D3CF12428B40E005DFA87 /* NCViewerPDFSearch.swift in Sources */,
 				F78ACD4F2190440D0088454D /* NCLayout.swift in Sources */,

+ 0 - 1
iOSClient/AppDelegate.m

@@ -22,7 +22,6 @@
 //
 
 #import "AppDelegate.h"
-#import "CCNetworking.h"
 #import "CCGraphics.h"
 #import "CCSynchronize.h"
 #import "CCMain.h"

+ 1 - 1
iOSClient/AutoUpload/NCAutoUpload.m

@@ -437,7 +437,7 @@
                 }];
                 
                 while (dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER))
-                       [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:k_timeout_webdav]];
+                       [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:30]];
             }
             
             [metadataFull addObject:metadataForUpload];

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1112,7 +1112,7 @@
                                 [[NCContentPresenter shared] messageNotification:@"_error_e2ee_" description:@"_e2e_error_decode_metadata_" delay:k_dismissAfterSecond type:messageTypeError errorCode:-999];
                             }
                                                         
-                        } else if (errorCode != kOCErrorServerPathNotFound) {
+                        } else if (errorCode != 404) {
                             
                             [[NCContentPresenter shared] messageNotification:@"_e2e_error_get_metadata_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode];
                         }

+ 3 - 3
iOSClient/Main/CCMore.swift

@@ -205,11 +205,11 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         }
 
         switch Double(tabAccount.quotaTotal) {
-        case Double(k_quota_space_not_computed):
+        case Double(-1):
             quota = "0"
-        case Double(k_quota_space_unknown):
+        case Double(-2):
             quota = NSLocalizedString("_quota_space_unknown_", comment: "")
-        case Double(k_quota_space_unlimited):
+        case Double(-3):
             quota = NSLocalizedString("_quota_space_unlimited_", comment: "")
         default:
             quota = CCUtility.transformedSize(Double(tabAccount.quotaTotal))

+ 0 - 44
iOSClient/Networking/CCNetworking.h

@@ -1,44 +0,0 @@
-//
-//  CCNetworking.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 01/06/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import <Photos/Photos.h>
-#import "OCCommunication.h"
-#import "OCFrameworkConstants.h"
-#import "PHAsset+Utility.h"
-#import "CCExifGeo.h"
-#import "CCGraphics.h"
-#import "CCError.h"
-
-@class tableMetadata;
-@class NCNetworkingE2EE;
-
-@interface CCNetworking : NSObject <NSURLSessionTaskDelegate, NSURLSessionDelegate>
-
-+ (CCNetworking *)sharedNetworking;
-
-//- (NSURLSession *)getSessionfromSessionDescription:(NSString *)sessionDescription;
-//- (void)uploadFile:(tableMetadata *)metadata taskStatus:(NSInteger)taskStatus;
-
-@end
-

+ 0 - 630
iOSClient/Networking/CCNetworking.m

@@ -1,630 +0,0 @@
-//
-//  CCNetworking.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 01/06/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCNetworking.h"
-#import "NCEndToEndEncryption.h"
-#import "AppDelegate.h"
-#import "NSDate+ISO8601.h"
-#import "NSString+Encode.h"
-#import "NCBridgeSwift.h"
-
-@interface CCNetworking ()
-{
-    
-}
-@end
-
-@implementation CCNetworking
-
-+ (CCNetworking *)sharedNetworking {
-    static CCNetworking *sharedNetworking;
-    @synchronized(self)
-    {
-        if (!sharedNetworking) {
-            sharedNetworking = [[CCNetworking alloc] init];
-        }
-        return sharedNetworking;
-    }
-}
-
-- (id)init
-{    
-    self = [super init];
-        
-    [self sessionUpload];
-    [self sessionWWanUpload];
-    
-    return self;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark =====  Session =====
-#pragma --------------------------------------------------------------------------------------------
-
-
-- (NSURLSession *)sessionUpload
-{
-    static NSURLSession *sessionUpload = nil;
-    
-    if (sessionUpload == nil) {
-        
-        NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@""];
-        
-        configuration.allowsCellularAccess = YES;
-        configuration.sessionSendsLaunchEvents = YES;
-        configuration.discretionary = NO;
-        configuration.HTTPMaximumConnectionsPerHost = k_maxHTTPConnectionsPerHost;
-        configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
-
-        sessionUpload = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];
-        sessionUpload.sessionDescription = @"";
-    }
-    return sessionUpload;
-}
-
-- (NSURLSession *)sessionWWanUpload
-{
-    static NSURLSession *sessionWWanUpload = nil;
-    
-    if (sessionWWanUpload == nil) {
-        
-        NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:@""];
-        
-        configuration.allowsCellularAccess = NO;
-        configuration.sessionSendsLaunchEvents = YES;
-        configuration.discretionary = NO;
-        configuration.HTTPMaximumConnectionsPerHost = k_maxHTTPConnectionsPerHost;
-        configuration.requestCachePolicy = NSURLRequestReloadIgnoringLocalCacheData;
-        
-        sessionWWanUpload = [NSURLSession sessionWithConfiguration:configuration delegate:self delegateQueue:nil];
-        sessionWWanUpload.sessionDescription = @"";
-    }
-    return sessionWWanUpload;
-}
-
-- (NSURLSession *)getSessionfromSessionDescription:(NSString *)sessionDescription
-{
-   
-    
-    return nil;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== URLSession download/upload =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
-{
-    // The pinnning check
-    if ([[NCNetworking shared] checkTrustedChallengeWithChallenge:challenge directoryCertificate:[CCUtility getDirectoryCerificates]]) {
-        completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
-    } else {
-        completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
-    }
-}
-
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
-{
-    NSString *url = [[[task currentRequest].URL absoluteString] stringByRemovingPercentEncoding];
-    
-    if (!url)
-        return;
-    
-    NSString *fileName = [url lastPathComponent];
-    NSString *serverUrl = [self getServerUrlFromUrl:url];
-    if (!serverUrl) return;
-    
-    NSInteger errorCode;
-    NSDate *date = [NSDate date];
-    NSDateFormatter *dateFormatter = [NSDateFormatter new];
-    NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
-    [dateFormatter setLocale:enUSPOSIXLocale];
-    [dateFormatter setDateFormat:@"EEE, dd MMM y HH:mm:ss zzz"];
-    
-    NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)task.response;
-    
-    if (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) {
-        
-        errorCode = error.code;
-        
-    } else {
-        
-        if (httpResponse.statusCode > 0)
-            errorCode = httpResponse.statusCode;
-        else
-            errorCode = error.code;
-    }
-
-    // ------------------------ UPLOAD -----------------------
-    
-    if ([task isKindOfClass:[NSURLSessionUploadTask class]]) {
-        
-        tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataInSessionFromFileName:fileName serverUrl:serverUrl taskIdentifier:task.taskIdentifier];
-        if (metadata) {
-            
-            NSDictionary *fields = [httpResponse allHeaderFields];
-            NSString *ocId = metadata.ocId;
-            NSString *etag = metadata.etag;
-            
-            if (errorCode == 0) {
-            
-                if ([CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"OC-FileId"]] != nil) {
-                    ocId = [CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"OC-FileId"]];
-                } else if ([CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"FileId"]] != nil) {
-                    ocId = [CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"FileId"]];
-                }
-                
-                if ([CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"OC-ETag"]] != nil) {
-                    etag = [CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"OC-ETag"]];
-                } else if ([CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"ETag"]] != nil) {
-                    etag = [CCUtility removeForbiddenCharactersFileSystem:[fields objectForKey:@"ETag"]];
-                }
-                
-                NSString *dateString = [fields objectForKey:@"Date"];
-                if (dateString) {
-                    if (![dateFormatter getObjectValue:&date forString:dateString range:nil error:&error]) {
-                        NSLog(@"[LOG] Date '%@' could not be parsed: %@", dateString, error);
-                        date = [NSDate date];
-                    }
-                } else {
-                    date = [NSDate date];
-                }
-            }
-                
-            if (fileName.length > 0 && ocId.length > 0 && serverUrl.length > 0) {
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    [self uploadFileSuccessFailure:metadata fileName:fileName ocId:ocId etag:etag date:date serverUrl:serverUrl errorCode:errorCode];
-                });
-            }
-        }
-    }
-}
-
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark =====  Upload =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)uploadFile:(tableMetadata *)metadata taskStatus:(NSInteger)taskStatus
-{
-    // Password nil
-    if ([CCUtility getPassword:metadata.account].length == 0) {
-                
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(kOCErrorServerUnauthorized), @"errorDescription": @"_bad_username_password_"}];
-        return;
-        
-    } else if ([CCUtility getCertificateError:metadata.account]) {
-        
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(NSURLErrorServerCertificateUntrusted), @"errorDescription": @"_ssl_certificate_untrusted_"}];
-        return;
-    }
-
-    if ([CCUtility fileProviderStorageExists:metadata.ocId fileNameView:metadata.fileNameView] == NO) {
-        
-        [CCUtility extractImageVideoFromAssetLocalIdentifierForUpload:metadata notification:true completion:^(tableMetadata *newMetadata, NSString *fileNamePath) {
-            
-            if (newMetadata == nil) {
-                
-                [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-                
-            } else {
-                
-                NSString *toPath = [CCUtility getDirectoryProviderStorageOcId:newMetadata.ocId fileNameView:newMetadata.fileNameView];
-                [CCUtility moveFileAtPath:fileNamePath toPath:toPath];
-                
-                tableMetadata *metadataForUpload = [[NCManageDatabase sharedInstance] addMetadata:newMetadata];
-                
-                if ([CCUtility isFolderEncrypted:metadataForUpload.serverUrl e2eEncrypted:metadataForUpload.e2eEncrypted account:metadataForUpload.account] && [CCUtility isEndToEndEnabled:metadataForUpload.account]) {
-                    [self e2eEncryptedFile:metadataForUpload taskStatus:taskStatus];
-                } else {
-                    [self uploadURLSessionMetadata:metadataForUpload taskStatus:taskStatus];
-                }
-            }
-        }];
-        
-    } else {
-        
-        NSDictionary *results = [[NCCommunicationCommon shared] objcGetInternalContenTypeWithFileName:metadata.fileNameView contentType:metadata.contentType directory:metadata.directory];
-        metadata.contentType = results[@"contentType"];
-        metadata.iconName = results[@"iconName"];
-        metadata.typeFile = results[@"typeFile"];
-
-        NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileName] error:nil];
-        
-        if (attributes[NSFileModificationDate]) {
-            metadata.date = attributes[NSFileModificationDate];
-        } else {
-            metadata.date = [NSDate date];
-        }
-        metadata.size = [attributes[NSFileSize] longValue];
-        
-        tableMetadata *metadataForUpload = [[NCManageDatabase sharedInstance] addMetadata:metadata];
-        
-        if ([CCUtility isFolderEncrypted:metadataForUpload.serverUrl e2eEncrypted:metadataForUpload.e2eEncrypted account:metadataForUpload.account] && [CCUtility isEndToEndEnabled:metadataForUpload.account]) {
-            [self e2eEncryptedFile:metadataForUpload taskStatus:taskStatus];
-        } else {
-            [self uploadURLSessionMetadata:metadataForUpload taskStatus:taskStatus];
-        }
-    }
-}
-
-- (void)e2eEncryptedFile:(tableMetadata *)metadata taskStatus:(NSInteger)taskStatus
-{
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", metadata.account]];
-    if (tableAccount == nil) {
-        [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(k_CCErrorInternalError), @"errorDescription": @"Upload error, account not found"}];
-        return;
-    }
-           
-    NSString *fileNameIdentifier;
-    NSString *key;
-    NSString *initializationVector;
-    NSString *authenticationTag;
-    NSString *metadataKey;
-    NSInteger metadataKeyIndex;
-
-    // Verify File Size
-    NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileNameView] error:nil];
-    NSNumber *fileSizeNumber = [fileAttributes objectForKey:NSFileSize];
-    long long fileSize = [fileSizeNumber longLongValue];
-
-    if (fileSize > k_max_filesize_E2EE) {
-        // Error for uploadFileFailure
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(k_CCErrorInternalError), @"errorDescription": @"E2E Error file too big"}];
-        return;
-    }
-        
-    // if new file upload create a new encrypted filename
-    fileNameIdentifier = [CCUtility generateRandomIdentifier];
-    
-    /*
-    if ([metadata.ocId isEqualToString:[CCUtility createMetadataIDFromAccount:metadata.account serverUrl:metadata.serverUrl fileNameView:metadata.fileNameView directory:false]]) {
-        fileNameIdentifier = [CCUtility generateRandomIdentifier];
-    } else {
-        fileNameIdentifier = metadata.fileName;
-    }
-    */
-    
-    [[NCEndToEndEncryption sharedManager] encryptFileName:metadata.fileNameView fileNameIdentifier:fileNameIdentifier directory:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId] key:&key initializationVector:&initializationVector authenticationTag:&authenticationTag];
-            
-    tableE2eEncryption *object = [[NCManageDatabase sharedInstance] getE2eEncryptionWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", tableAccount.account, metadata.serverUrl]];
-    if (object) {
-        metadataKey = object.metadataKey;
-        metadataKeyIndex = object.metadataKeyIndex;
-    } else {
-        metadataKey = [[[NCEndToEndEncryption sharedManager] generateKey:16] base64EncodedStringWithOptions:0]; // AES_KEY_128_LENGTH
-        metadataKeyIndex = 0;
-    }
-        
-    tableE2eEncryption *addObject = [tableE2eEncryption new];
-    
-    addObject.account = tableAccount.account;
-    addObject.authenticationTag = authenticationTag;
-    addObject.fileName = metadata.fileNameView;
-    addObject.fileNameIdentifier = fileNameIdentifier;
-    addObject.fileNamePath = [CCUtility returnFileNamePathFromFileName:metadata.fileNameView serverUrl:metadata.serverUrl activeUrl:tableAccount.url];
-    addObject.key = key;
-    addObject.initializationVector = initializationVector;
-    addObject.metadataKey = metadataKey;
-    addObject.metadataKeyIndex = metadataKeyIndex;
-        
-    CFStringRef UTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)[metadata.fileNameView pathExtension], NULL);
-    CFStringRef mimeTypeRef = UTTypeCopyPreferredTagWithClass (UTI, kUTTagClassMIMEType);
-    if (mimeTypeRef) {
-        addObject.mimeType = (__bridge NSString *)mimeTypeRef;
-    } else {
-        addObject.mimeType = @"application/octet-stream";
-    }
-    
-    addObject.serverUrl = metadata.serverUrl;
-    NSString *e2eeApiVersion = [[NCManageDatabase sharedInstance] getCapabilitiesServerStringWithAccount:tableAccount.account elements:NCElementsJSON.shared.capabilitiesE2EEApiVersion];
-    addObject.version = [e2eeApiVersion intValue];
-    
-    // Get the last metadata
-    tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", tableAccount.account, metadata.serverUrl]];
-        
-    [[NCCommunication shared] getE2EEMetadataWithFileId:directory.fileId e2eToken:nil customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *account, NSString *e2eMetadata, NSInteger errorCode, NSString *errorDescription) {
-        if (errorCode == 0 && e2eMetadata != nil) {
-            if ([[NCEndToEndMetadata sharedInstance] decoderMetadata:e2eMetadata privateKey:[CCUtility getEndToEndPrivateKey:tableAccount.account] serverUrl:directory.serverUrl account:tableAccount.account url:tableAccount.url] == false) {
-                [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(k_CCErrorInternalError), @"errorDescription": @"_e2e_error_decode_metadata_"}];
-                return;
-            }
-        }
-            
-        if([[NCManageDatabase sharedInstance] addE2eEncryption:addObject] == NO) {
-            
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(k_CCErrorInternalError), @"errorDescription": @"_e2e_error_create_encrypted_"}];
-            return;
-        }
-        
-        // Now the fileName is fileNameIdentifier && flag e2eEncrypted
-        metadata.fileName = fileNameIdentifier;
-        metadata.e2eEncrypted = YES;
-        
-        // Update Metadata
-        tableMetadata *metadataEncrypted = [[NCManageDatabase sharedInstance] addMetadata:metadata];
-        
-        [self uploadURLSessionMetadata:metadataEncrypted taskStatus:taskStatus];
-        
-    }];
-}
-
-- (void)uploadURLSessionMetadata:(tableMetadata *)metadata taskStatus:(NSInteger)taskStatus
-{
-    NSURL *url;
-    NSMutableURLRequest *request;
-    PHAsset *asset;
-    NSError *error;
-    
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", metadata.account]];
-    if (tableAccount == nil) {
-        [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(k_CCErrorInternalError), @"errorDescription": @"Upload error, account not found"}];
-        return;
-    }
-    
-    // calculate and store file size
-    NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileName] error:&error];
-    long long fileSize = [[fileAttributes objectForKey:NSFileSize] longLongValue];
-    metadata.size = fileSize;
-    [[NCManageDatabase sharedInstance] addMetadata:metadata];
-    
-    url = [NSURL URLWithString:[[NSString stringWithFormat:@"%@/%@", metadata.serverUrl, metadata.fileName] encodeString:NSUTF8StringEncoding]];
-    request = [NSMutableURLRequest requestWithURL:url];
-        
-    NSData *authData = [[NSString stringWithFormat:@"%@:%@", tableAccount.user, [CCUtility getPassword:tableAccount.account]] dataUsingEncoding:NSUTF8StringEncoding];
-    NSString *authValue = [NSString stringWithFormat: @"Basic %@",[authData base64EncodedStringWithOptions:0]];
-    [request setHTTPMethod:@"PUT"];
-    [request setValue:authValue forHTTPHeaderField:@"Authorization"];
-    [request setValue:[CCUtility getUserAgent] forHTTPHeaderField:@"User-Agent"];
-
-    // Create Image for Upload (gray scale)
-#ifndef EXTENSION
-    [CCGraphics createNewImageFrom:metadata.fileNameView ocId:metadata.ocId filterGrayScale:YES typeFile:metadata.typeFile writeImage:YES];
-#endif
-    
-    // Change date file upload with header : X-OC-Mtime (ctime assetLocalIdentifier) image/video
-    if (metadata.assetLocalIdentifier) {
-        PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[metadata.assetLocalIdentifier] options:nil];
-        if (result.count) {
-            asset = result[0];
-            long dateFileCreation = [asset.creationDate timeIntervalSince1970];
-            [request setValue:[NSString stringWithFormat:@"%ld", dateFileCreation] forHTTPHeaderField:@"X-OC-Mtime"];
-        }
-    }
-         
-     // NSURLSession
-     NSURLSession *sessionUpload;
-//     if ([metadata.session isEqualToString:k_upload_session]) sessionUpload = [self sessionUpload];
-//     else if ([metadata.session isEqualToString:k_upload_session_wwan]) sessionUpload = [self sessionWWanUpload];
-     
-     NSURLSessionUploadTask *uploadTask = [sessionUpload uploadTaskWithRequest:request fromFile:[NSURL fileURLWithPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId fileNameView:metadata.fileName]]];
-     
-     // Manage uploadTask cancel,suspend,resume
-     if (taskStatus == k_taskStatusCancel) [uploadTask cancel];
-     else if (taskStatus == k_taskStatusSuspend) [uploadTask suspend];
-     else if (taskStatus == k_taskStatusResume) [uploadTask resume];
-     
-     // *** PLAIN ***
-     [[NCManageDatabase sharedInstance] setMetadataSession:metadata.session sessionError:@"" sessionSelector:nil sessionTaskIdentifier:uploadTask.taskIdentifier status:k_metadataStatusUploading predicate:[NSPredicate predicateWithFormat:@"ocId == %@", metadata.ocId]];
-     
-     NSLog(@"[LOG] Upload file %@ TaskIdentifier %lu", metadata.fileName, (unsigned long)uploadTask.taskIdentifier);
-     
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadFileStart object:nil userInfo:@{@"ocId": metadata.ocId, @"task": uploadTask, @"serverUrl": metadata.serverUrl, @"account": metadata.account}];
-    
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_reloadDataSource object:nil userInfo:@{@"ocId": metadata.ocId,@"serverUrl": metadata.serverUrl}];
-}
-
-- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
-{
-}
-
-- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didSendBodyData:(int64_t)bytesSent totalBytesSent:(int64_t)totalBytesSent totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
-{
-    NSString *url = [[[task currentRequest].URL absoluteString] stringByRemovingPercentEncoding];
-    NSString *fileName = [url lastPathComponent];
-    NSString *serverUrl = [self getServerUrlFromUrl:url];
-    if (!serverUrl) return;
-    
-    if (totalBytesExpectedToSend < 1) {
-        totalBytesExpectedToSend = totalBytesSent;
-    }
-    
-    float progress = (float) totalBytesSent / (float)totalBytesExpectedToSend;
-
-    tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataInSessionFromFileName:fileName serverUrl:serverUrl taskIdentifier:task.taskIdentifier];
-    
-    if (metadata) {
-        NSDictionary *userInfo = @{@"account": (metadata.account), @"ocId": (metadata.ocId), @"serverUrl": (serverUrl), @"status": ([NSNumber numberWithLong:k_metadataStatusInUpload]), @"progress": ([NSNumber numberWithFloat:progress]), @"totalBytes": ([NSNumber numberWithLongLong:totalBytesSent]), @"totalBytesExpected": ([NSNumber numberWithLongLong:totalBytesExpectedToSend])};
-        if (userInfo)
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_progressTask object:nil userInfo:userInfo];
-    }
-}
-
-- (void)uploadFileSuccessFailure:(tableMetadata *)metadata fileName:(NSString *)fileName ocId:(NSString *)ocId etag:(NSString *)etag date:(NSDate *)date serverUrl:(NSString *)serverUrl errorCode:(NSInteger)errorCode
-{
-    NSString *tempocId = metadata.ocId;
-    NSString *errorMessage = @"";
-
-    tableAccount *tableAccount = [[NCManageDatabase sharedInstance] getAccountWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", metadata.account]];
-    if (tableAccount == nil) {
-        [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", tempocId]];
-
-        [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(errorCode), @"errorDescription": errorMessage}];
-        return;
-    }
-
-    // ERRORE
-    if (errorCode != 0) {
-        
-#ifndef EXTENSION
-        AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-        [appDelegate.listProgressMetadata removeObjectForKey:metadata.ocId];
-#endif
-        
-        // Mark error only if not Cancelled Task
-        if (errorCode == kCFURLErrorCancelled)  {
-            
-            if (metadata.status == k_metadataStatusUploadForcedStart) {
-                
-                errorCode = 0;
-                
-                //metadata.session = k_upload_session;
-                metadata.sessionError = @"";
-                metadata.sessionTaskIdentifier = 0;
-                metadata.status = k_metadataStatusInUpload;
-                metadata = [[NCManageDatabase sharedInstance] addMetadata:metadata];
-
-                [[CCNetworking sharedNetworking] uploadFile:metadata taskStatus:k_taskStatusResume];
-                
-            } else {
-                
-                [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:tempocId] error:nil];
-                [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", tempocId]];
-                
-                errorMessage = [CCError manageErrorKCF:errorCode withNumberError:YES];
-            }
-            
-        } else {
-
-            if (metadata && (errorCode == kOCErrorServerUnauthorized || errorCode == kOCErrorServerForbidden)) {
-#ifndef EXTENSION
-                [[NCNetworkingCheckRemoteUser shared] checkRemoteUserWithAccount:metadata.account];
-#endif
-            } else if (metadata && errorCode == NSURLErrorServerCertificateUntrusted) {
-                [CCUtility setCertificateError:metadata.account error:YES];
-            }
-            
-            [[NCManageDatabase sharedInstance] setMetadataSession:nil sessionError:[CCError manageErrorKCF:errorCode withNumberError:NO] sessionSelector:nil sessionTaskIdentifier:k_taskIdentifierDone status:k_metadataStatusUploadError predicate:[NSPredicate predicateWithFormat:@"ocId == %@", tempocId]];
-            
-            errorMessage = [CCError manageErrorKCF:errorCode withNumberError:YES];
-        }
-        
-    } else {
-    
-        // Delete Asset
-        if (tableAccount.autoUploadDeleteAssetLocalIdentifier && ![metadata.assetLocalIdentifier isEqualToString:@""] && [metadata.sessionSelector isEqualToString:selectorUploadAutoUpload]) {
-            metadata.deleteAssetLocalIdentifier = true;
-        }
-        
-        // Edited file, remove tempocId and adjust the directory provider storage
-        if (metadata.edited) {
-            
-            // Update metadata tempocId
-            [[NCManageDatabase sharedInstance] setMetadataSession:@"" sessionError:@"" sessionSelector:@"" sessionTaskIdentifier:k_taskIdentifierDone status:k_metadataStatusNormal predicate:[NSPredicate predicateWithFormat:@"ocId == %@", tempocId]];
-            
-            // Add metadata ocId
-            metadata.date = date;
-            metadata.etag = etag;
-            metadata.ocId = ocId;
-            metadata.session = @"";
-            metadata.sessionError = @"";
-            metadata.sessionTaskIdentifier = k_taskIdentifierDone;
-            metadata.status = k_metadataStatusNormal;
-            
-            metadata = [[NCManageDatabase sharedInstance] addMetadata:metadata];
-            
-            // Copy new version on old version
-            if (![tempocId isEqualToString:metadata.ocId]) {
-                [CCUtility copyFileAtPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], tempocId] toPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], metadata.ocId]];
-                [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", tempocId]];
-                // IMI -> Unzip
-#if HC
-                if ([metadata.typeFile isEqualToString:k_metadataTypeFile_imagemeter]) {
-                    (void)[[IMUtility shared] IMUnzipWithMetadata:metadata];
-                }
-#endif
-            }
-            
-        } else {
-            
-            // Replace Metadata
-            metadata.date = date;
-            metadata.etag = etag;
-            metadata.ocId = ocId;
-            metadata.session = @"";
-            metadata.sessionError = @"";
-            metadata.sessionTaskIdentifier = k_taskIdentifierDone;
-            metadata.status = k_metadataStatusNormal;
-            
-            [CCUtility moveFileAtPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], tempocId] toPath:[NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorage], metadata.ocId]];
-            
-            [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND fileName == %@", metadata.account, metadata.serverUrl, metadata.fileName]];
-            metadata = [[NCManageDatabase sharedInstance] addMetadata:metadata];
-            
-            NSLog(@"[LOG] Insert new upload : %@ - ocId : %@", metadata.fileName, ocId);
-        }
-#ifndef EXTENSION
-        
-        // EXIF
-        if ([metadata.typeFile isEqualToString: k_metadataTypeFile_image])
-            [[CCExifGeo sharedInstance] setExifLocalTableEtag:metadata];
-        
-        // Create preview
-        [CCGraphics createNewImageFrom:metadata.fileNameView ocId:metadata.ocId filterGrayScale:NO typeFile:metadata.typeFile writeImage:YES];
-
-        // Copy photo or video in the photo album for auto upload
-        if ([metadata.assetLocalIdentifier length] > 0 && ([metadata.sessionSelector isEqualToString:selectorUploadAutoUpload] || [metadata.sessionSelector isEqualToString:selectorUploadFile])) {
-            
-            PHAsset *asset;
-            PHFetchResult *result = [PHAsset fetchAssetsWithLocalIdentifiers:@[metadata.assetLocalIdentifier] options:nil];
-            
-            if(result.count){
-                asset = result[0];
-                
-                [asset saveToAlbum:[NCBrandOptions sharedInstance].brand completionBlock:^(BOOL success) {
-                    if (success) NSLog(@"[LOG] Insert file %@ in %@", metadata.fileName, [NCBrandOptions sharedInstance].brand);
-                    else NSLog(@"[LOG] File %@ do not insert in %@", metadata.fileName, [NCBrandOptions sharedInstance].brand);
-                }];
-            }
-        }
- #endif
-        
-        // Add Local or Remove from cache
-        if ([CCUtility getDisableLocalCacheAfterUpload] && !metadata.edited) {
-            [[NSFileManager defaultManager] removeItemAtPath:[CCUtility getDirectoryProviderStorageOcId:metadata.ocId] error:nil];
-        } else {
-            // Add Local
-            (void)[[NCManageDatabase sharedInstance] addLocalFileWithMetadata:metadata];
-        }
-    }
-    
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_uploadedFile object:nil userInfo:@{@"metadata": metadata, @"errorCode": @(errorCode), @"errorDescription": errorMessage}];
-    [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:k_notificationCenter_reloadDataSource object:nil userInfo:@{@"ocId": metadata.ocId,@"serverUrl": metadata.serverUrl}];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark =====  Utility =====
-#pragma --------------------------------------------------------------------------------------------
-
-- (NSString *)getServerUrlFromUrl:(NSString *)url
-{
-    NSString *fileName = [url lastPathComponent];
-    
-    url = [url stringByReplacingOccurrencesOfString:[@"/" stringByAppendingString:fileName] withString:@""];
-
-    return url;
-}
-
-@end

+ 1 - 1
iOSClient/Networking/NCNetworking.swift

@@ -688,7 +688,7 @@ import Alamofire
         let serverUrlFileName = metadata.serverUrl + "/" + metadata.fileName
         NCCommunication.shared.deleteFileOrFolder(serverUrlFileName, customUserAgent: nil, addCustomHeaders: addCustomHeaders) { (account, errorCode, errorDescription) in
         
-            if errorCode == 0 || errorCode == kOCErrorServerPathNotFound {
+            if errorCode == 0 || errorCode == 404 {
                 
                 do {
                     try FileManager.default.removeItem(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))

+ 2 - 2
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -146,7 +146,7 @@ import Foundation
                 } else {
                     
                     // File do not exists on server, remove in local
-                    if (errorCode == kOCErrorServerPathNotFound || errorCode == -1011) { // - 1011 = kCFURLErrorBadServerResponse
+                    if (errorCode == 404 || errorCode == -1011) { // - 1011 = kCFURLErrorBadServerResponse
                         
                         do {
                             try FileManager.default.removeItem(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
@@ -181,7 +181,7 @@ import Foundation
                     if errorCode == 0 {
                         appDelegate.startLoadAutoUpload()
                     } else {
-                        if errorCode != -999 && errorCode != kOCErrorServerUnauthorized && errorDescription != "" {
+                        if errorCode != -999 && errorCode != 401 && errorDescription != "" {
                             NCContentPresenter.shared.messageNotification("_upload_file_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: errorCode)
                         }
                     }

+ 2 - 2
iOSClient/Networking/NCService.swift

@@ -115,7 +115,7 @@ class NCService: NSObject {
                 
             } else {
                 
-                if errorCode == kOCErrorServerUnauthorized || errorCode == kOCErrorServerForbidden {
+                if errorCode == 401 || errorCode == 403 {
                     NCNetworkingCheckRemoteUser.shared.checkRemoteUser(account: account)
                 }
                 
@@ -209,7 +209,7 @@ class NCService: NSObject {
                 
                 self.appDelegate.settingThemingColorBrand()
                 
-                if errorCode == kOCErrorServerUnauthorized || errorCode == kOCErrorServerForbidden {
+                if errorCode == 401 || errorCode == 403 {
                     NCNetworkingCheckRemoteUser.shared.checkRemoteUser(account: account)
                 }
                 

+ 2 - 1
iOSClient/Networking/OCNetworking.h

@@ -22,9 +22,10 @@
 //
 
 #import <Foundation/Foundation.h>
-#import "CCNetworking.h"
+#import "OCCommunication.h"
 @import AFNetworking;
 
+
 @interface OCNetworking : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate>
 
 + (OCNetworking *)sharedManager;

+ 3 - 0
iOSClient/Networking/OCNetworking.m

@@ -22,6 +22,9 @@
 //
 
 #import "OCNetworking.h"
+#import "OCFrameworkConstants.h"
+#import "OCCommunication.h"
+#import "OCErrorMsg.h"
 
 #import "CCUtility.h"
 #import "CCGraphics.h"

+ 0 - 1
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -23,7 +23,6 @@
 
 #import "NCManageEndToEndEncryption.h"
 #import "AppDelegate.h"
-#import "CCNetworking.h"
 #import <TOPasscodeViewController/TOPasscodeViewController.h>
 
 #import "NCBridgeSwift.h"

+ 0 - 1
iOSClient/Settings/NCNetworkingEndToEnd.h

@@ -22,7 +22,6 @@
 //
 
 #import <Foundation/Foundation.h>
-#import "CCNetworking.h"
 
 @interface NCNetworkingEndToEnd : NSObject
 

+ 1 - 1
iOSClient/Synchronize/CCSynchronize.m

@@ -191,7 +191,7 @@
                     [self verifyChangeMedatas:[[NSArray alloc] initWithObjects:addMetadata, nil] serverUrl:serverUrl account:account withDownload:withDownload];
             });
             
-        } else if (errorCode == kOCErrorServerPathNotFound) {
+        } else if (errorCode == 404) {
                 
             [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", ocId]];
             [[NCManageDatabase sharedInstance] deleteLocalFileWithPredicate:[NSPredicate predicateWithFormat:@"ocId == %@", ocId]];

+ 2 - 1
iOSClient/Utility/CCUtility.h

@@ -28,10 +28,11 @@
 #import <AssetsLibrary/AssetsLibrary.h>
 #import <MessageUI/MessageUI.h>
 #import <UICKeyChainStore/UICKeyChainStore.h>
+#import <Photos/Photos.h>
 
 #import "OCFileDto.h"
 #import "CCGlobal.h"
-#import "CCNetworking.h"
+#import "CCGraphics.h"
 
 @class tableMetadata;
 

+ 1 - 0
iOSClient/Utility/NCUtilityFileSystem.swift

@@ -22,6 +22,7 @@
 //
 
 import Foundation
+import PhotosUI
 
 class NCUtilityFileSystem: NSObject {
     @objc static let shared: NCUtilityFileSystem = {