marinofaggiana 4 年 前
コミット
0473bd9b64

+ 3 - 3
File Provider Extension/FileProviderData.swift

@@ -95,7 +95,7 @@ class fileProviderData: NSObject {
             accountUrlBase = accountActive.urlBase
             homeServerUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: accountActive.urlBase, account: accountActive.account)
                         
-            NCCommunicationCommon.shared.setup(account: accountActive.account, user: accountActive.user, userId: accountActive.userID, password: CCUtility.getPassword(accountActive.account), urlBase: accountActive.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+            NCCommunicationCommon.shared.setup(account: accountActive.account, user: accountActive.user, userId: accountActive.userId, password: CCUtility.getPassword(accountActive.account), urlBase: accountActive.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
             NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
             
             return tableAccount.init(value: accountActive)
@@ -108,7 +108,7 @@ class fileProviderData: NSObject {
         for accountActive in accounts {
             guard let url = NSURL(string: accountActive.urlBase) else { continue }
             guard let host = url.host else { continue }
-            let accountDomain = accountActive.userID + " (" + host + ")"
+            let accountDomain = accountActive.userId + " (" + host + ")"
             if accountDomain == domain!.identifier.rawValue {
                 
                 let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: accountActive.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
@@ -118,7 +118,7 @@ class fileProviderData: NSObject {
                 accountUrlBase = accountActive.urlBase
                 homeServerUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: accountActive.urlBase, account: accountActive.account)
                 
-                NCCommunicationCommon.shared.setup(account: accountActive.account, user: accountActive.user, userId: accountActive.userID, password: CCUtility.getPassword(accountActive.account), urlBase: accountActive.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
+                NCCommunicationCommon.shared.setup(account: accountActive.account, user: accountActive.user, userId: accountActive.userId, password: CCUtility.getPassword(accountActive.account), urlBase: accountActive.urlBase, userAgent: CCUtility.getUserAgent(), webDav: webDav, dav: nil, nextcloudVersion: serverVersionMajor, delegate: NCNetworking.shared)
                 NCNetworking.shared.delegate = providerExtension as? NCNetworkingDelegate
 
                 return tableAccount.init(value: accountActive)

+ 2 - 2
File Provider Extension/FileProviderDomain.swift

@@ -43,7 +43,7 @@ class FileProviderDomain: NSObject {
                 for account in accounts {
                     guard let urlBase = NSURL(string: account.urlBase) else { continue }
                     guard let host = urlBase.host else { continue }
-                    let accountDomain =  account.userID + " (" + host + ")"
+                    let accountDomain =  account.userId + " (" + host + ")"
                     if domain == accountDomain {
                         domainFound = true
                         break
@@ -64,7 +64,7 @@ class FileProviderDomain: NSObject {
                 var domainFound = false
                 guard let urlBase = NSURL(string: account.urlBase) else { continue }
                 guard let host = urlBase.host else { continue }
-                let accountDomain =  account.userID + " (" + host + ")"
+                let accountDomain =  account.userId + " (" + host + ")"
                 for domain in domains {
                     if domain == accountDomain {
                         domainFound = true

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -2788,8 +2788,8 @@
 			isa = XCRemoteSwiftPackageReference;
 			repositoryURL = "https://github.com/nextcloud/ios-communication-library/";
 			requirement = {
-				kind = exactVersion;
-				version = 0.93.0;
+				kind = revision;
+				revision = 6dadd60065c28957201f6822183c6400fca64e51;
 			};
 		};
 		F7C4D88B2534887E00C142DA /* XCRemoteSwiftPackageReference "Parchment" */ = {

+ 2 - 2
Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -24,8 +24,8 @@
         "repositoryURL": "https://github.com/nextcloud/ios-communication-library/",
         "state": {
           "branch": null,
-          "revision": "2711ac3bb0a047f470a2b038176765725a30e1c5",
-          "version": "0.93.0"
+          "revision": "6dadd60065c28957201f6822183c6400fca64e51",
+          "version": null
         }
       },
       {

+ 1 - 1
Share/ShareViewController.m

@@ -75,7 +75,7 @@
         [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"Start session with level %lu %@", (unsigned long)levelLog, versionNextcloudiOS]];
         
         // Networking
-        [[NCCommunicationCommon shared] setupWithAccount:tableAccount.account user:tableAccount.user userId:tableAccount.userID password:[CCUtility getPassword:tableAccount.account] urlBase:tableAccount.urlBase userAgent:[CCUtility getUserAgent] webDav:webDav dav:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking shared]];
+        [[NCCommunicationCommon shared] setupWithAccount:tableAccount.account user:tableAccount.user userId:tableAccount.userId password:[CCUtility getPassword:tableAccount.account] urlBase:tableAccount.urlBase userAgent:[CCUtility getUserAgent] webDav:webDav dav:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking shared]];
        
         _account = tableAccount.account;
         _urlBase = tableAccount.urlBase;

+ 2 - 2
iOSClient/Activity/NCActivity.swift

@@ -216,7 +216,7 @@ extension NCActivity: UITableViewDataSource {
             }
             
             // avatar
-            if activity.user.count > 0 && activity.user != appDelegate.userID {
+            if activity.user.count > 0 && activity.user != appDelegate.userId {
                 
                 cell.subjectTrailingConstraint.constant = 50
                 cell.avatar.isHidden = false
@@ -229,7 +229,7 @@ extension NCActivity: UITableViewDataSource {
                     }
                 } else {
                     DispatchQueue.global().async {
-                        NCCommunication.shared.downloadAvatar(userID: activity.user, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadAvatar(userId: activity.user, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.account && UIImage(data: data!) != nil {
                                 cell.avatar.image = UIImage(data: data!)
                             }

+ 8 - 8
iOSClient/AppDelegate.swift

@@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     @objc var account: String = ""
     @objc var urlBase: String = ""
     @objc var user: String = ""
-    @objc var userID: String = ""
+    @objc var userId: String = ""
     @objc var password: String = ""
     
     var activeAppConfigView: NCAppConfigView?
@@ -120,7 +120,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                 NCManageDatabase.shared.updateAccount(tableAccount)
             }
             
-            settingAccount(tableAccount.account, urlBase: tableAccount.urlBase, user: tableAccount.user, userID: tableAccount.userID, password: CCUtility.getPassword(tableAccount.account))
+            settingAccount(tableAccount.account, urlBase: tableAccount.urlBase, user: tableAccount.user, userId: tableAccount.userId, password: CCUtility.getPassword(tableAccount.account))
             
         } else {
             
@@ -534,17 +534,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     
     // MARK: - Account & Communication
     
-    @objc func settingAccount(_ account: String, urlBase: String, user: String, userID: String, password: String) {
+    @objc func settingAccount(_ account: String, urlBase: String, user: String, userId: String, password: String) {
         
         self.account = account
         self.urlBase = urlBase
         self.user = user
-        self.userID = userID
+        self.userId = userId
         self.password = password
         
         _ = NCNetworkingNotificationCenter.shared
         
-        NCCommunicationCommon.shared.setup(account: account, user: user, userId: userID, password: password, urlBase: urlBase)
+        NCCommunicationCommon.shared.setup(account: account, user: user, userId: userId, password: password, urlBase: urlBase)
         NCCommunicationCommon.shared.setup(webDav: NCUtilityFileSystem.shared.getWebDAV(account: account))
         NCCommunicationCommon.shared.setup(dav: NCUtilityFileSystem.shared.getDAV())
         let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
@@ -560,7 +560,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             NCPushNotification.shared().unsubscribingNextcloudServerPushNotification(account.account, urlBase: account.urlBase, user: account.user, withSubscribing: false)
         }
         
-        settingAccount("", urlBase: "", user: "", userID: "", password: "")
+        settingAccount("", urlBase: "", user: "", userId: "", password: "")
         
         let results = NCManageDatabase.shared.getTableLocalFiles(predicate: NSPredicate(format: "account == %@", account), sorted: "ocId", ascending: false)
         for result in results {
@@ -578,7 +578,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             if accounts?.count ?? 0 > 0 {
                 if let newAccount = accounts?.first {
                     if let account = NCManageDatabase.shared.setAccountActive(newAccount) {
-                        settingAccount(account.account, urlBase: account.urlBase, user: account.user, userID: account.userID, password: CCUtility.getPassword(account.account))
+                        settingAccount(account.account, urlBase: account.urlBase, user: account.user, userId: account.userId, password: CCUtility.getPassword(account.account))
                         NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterInitializeMain)
                     }
                 }
@@ -706,7 +706,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
                                 let accountUser = account.user
                                 if link?.contains(accountURL.host ?? "") ?? false && user == accountUser {
                                     matchedAccount = NCManageDatabase.shared.setAccountActive(accountUser)
-                                    settingAccount(matchedAccount!.account, urlBase: matchedAccount!.urlBase, user: matchedAccount!.user, userID: matchedAccount!.userID, password: CCUtility.getPassword(matchedAccount!.account))
+                                    settingAccount(matchedAccount!.account, urlBase: matchedAccount!.urlBase, user: matchedAccount!.user, userId: matchedAccount!.userId, password: CCUtility.getPassword(matchedAccount!.account))
                                     NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterInitializeMain)
                                 }
                             }

+ 1 - 1
iOSClient/Brand/NCBrand.swift

@@ -278,7 +278,7 @@ class NCBrandColor: NSObject {
 
     // Database Realm
     let databaseDefault                             = "nextcloud.realm"
-    let databaseSchemaVersion: UInt64               = 161
+    let databaseSchemaVersion: UInt64               = 162
     
     // Intro selector
     @objc let introLogin: Int                       = 0

+ 1 - 1
iOSClient/Data/NCDatabase.swift

@@ -68,7 +68,7 @@ class tableAccount: Object {
     @objc dynamic var twitter = ""
     @objc dynamic var urlBase = ""
     @objc dynamic var user = ""
-    @objc dynamic var userID = ""
+    @objc dynamic var userId = ""
     @objc dynamic var userStatusClearAt: NSDate? = nil
     @objc dynamic var userStatusIcon: String?
     @objc dynamic var userStatusMessage: String?

+ 8 - 2
iOSClient/Data/NCManageDatabase.swift

@@ -124,6 +124,12 @@ class NCManageDatabase: NSObject {
                         migration.deleteData(forType: tableMetadata.className())
                     }
                     
+                    if oldSchemaVersion < 162 {
+                        migration.enumerateObjects(ofType: tableAccount.className()) { oldObject, newObject in
+                            newObject!["userId"] = oldObject!["userID"]
+                        }
+                    }
+                    
                 }, shouldCompactOnLaunch: { totalBytes, usedBytes in
                     
                     // totalBytes refers to the size of the file on disk in bytes (data + free space)
@@ -293,7 +299,7 @@ class NCManageDatabase: NSObject {
                 
                 addObject.urlBase = urlBase
                 addObject.user = user
-                addObject.userID = user
+                addObject.userId = user
            
                 realm.add(addObject, update: .all)
             }
@@ -548,7 +554,7 @@ class NCManageDatabase: NSObject {
                 result.storageLocation = userProfile.storageLocation
                 result.subadmin = userProfile.subadmin.joined(separator: ",")
                 result.twitter = userProfile.twitter
-                result.userID = userProfile.userId
+                result.userId = userProfile.userId
                 result.webpage = userProfile.webpage
                 
                 returnAccount = result

+ 1 - 1
iOSClient/Login/CCLogin.m

@@ -399,7 +399,7 @@
         tableAccount *tableAccount = [[NCManageDatabase shared] setAccountActive:account];
         
         // Setting appDelegate active account
-        [appDelegate settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userID:tableAccount.userID password:[CCUtility getPassword:tableAccount.account]];
+        [appDelegate settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userId:tableAccount.userId password:[CCUtility getPassword:tableAccount.account]];
         
         if ([CCUtility getIntro]) {
             [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCBrandGlobal.shared.notificationCenterInitializeMain object:nil userInfo:nil];

+ 1 - 1
iOSClient/Login/NCAppConfigView.swift

@@ -91,7 +91,7 @@ class NCAppConfigView: UIViewController {
                         return
                     }
                     
-                    self.appDelegate.settingAccount(account, urlBase: serverUrl, user: username, userID: tableAccount.userID, password: token!)
+                    self.appDelegate.settingAccount(account, urlBase: serverUrl, user: username, userId: tableAccount.userId, password: token!)
                     NotificationCenter.default.postOnMainThread(name: NCBrandGlobal.shared.notificationCenterInitializeMain)
                     
                     self.dismiss(animated: true) {}

+ 1 - 1
iOSClient/Login/NCLoginWeb.swift

@@ -231,7 +231,7 @@ extension NCLoginWeb: WKNavigationDelegate {
             return
         }
             
-        appDelegate.settingAccount(account, urlBase: urlBase, user: username, userID: tableAccount.userID, password: password)
+        appDelegate.settingAccount(account, urlBase: urlBase, user: username, userId: tableAccount.userId, password: password)
             
         if (CCUtility.getIntro()) {
             

+ 2 - 2
iOSClient/Main/Colleaction Common/NCCollectionViewCommon.swift

@@ -1269,14 +1269,14 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
             } else {
                 cell.imageShared.image = NCCollectionCommon.images.cellCanShareImage
             }
-            if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userID {
+            if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userId {
                 var fileNameUser = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + metadata.ownerId
                 fileNameUser = fileNameUser + ".png"
                 if FileManager.default.fileExists(atPath: fileNameUser) {
                     cell.imageShared.avatar()
                     cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)
                 } else {
-                    NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameUser, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userId: metadata.ownerId, fileNameLocalPath: fileNameUser, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.account {
                             cell.imageShared.avatar()
                             cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)

+ 2 - 2
iOSClient/Networking/NCService.swift

@@ -65,7 +65,7 @@ class NCService: NSObject {
                     let url = tableAccount.urlBase
                     let stringUser = CCUtility.getStringUser(user, urlBase: url)!
                     
-                    self.appDelegate.settingAccount(tableAccount.account, urlBase: tableAccount.urlBase, user: tableAccount.user, userID: tableAccount.userID, password: CCUtility.getPassword(tableAccount.account))
+                    self.appDelegate.settingAccount(tableAccount.account, urlBase: tableAccount.urlBase, user: tableAccount.user, userId: tableAccount.userId, password: CCUtility.getPassword(tableAccount.account))
                        
                     // Synchronize favorite                    
                     NCNetworking.shared.listingFavoritescompletion(selector: NCBrandGlobal.shared.selectorReadFile) { (_, _, _, _) in }
@@ -215,7 +215,7 @@ class NCService: NSObject {
                     let userStatus = NCManageDatabase.shared.getCapabilitiesServerBool(account: account, elements: NCElementsJSON.shared.capabilitiesUserStatusEnabled, exists: false)
                     if userStatus {
                         NCCommunication.shared.getUserStatus { (account, clearAt, icon, message, messageId, messageIsPredefined, status, statusIsUserDefined, userId, errorCode, errorDescription) in
-                            if errorCode == 0 && account == self.appDelegate.account && userId == self.appDelegate.userID {
+                            if errorCode == 0 && account == self.appDelegate.account && userId == self.appDelegate.userId {
                                 
                                 DispatchQueue.global().async {
                                 

+ 1 - 1
iOSClient/Notification/NCNotification.swift

@@ -131,7 +131,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
                         }
                     } else {
                         DispatchQueue.global().async {
-                            NCCommunication.shared.downloadAvatar(userID: name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.account) { (account, data, errorCode, errorMessage) in
+                            NCCommunication.shared.downloadAvatar(userId: name, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size), customUserAgent: nil, addCustomHeaders: nil, account: self.appDelegate.account) { (account, data, errorCode, errorMessage) in
                                 if errorCode == 0 && account == self.appDelegate.account && UIImage(data: data!) != nil {
                                     if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                         cell.avatar.isHidden = false

+ 1 - 1
iOSClient/Recent/NCRecent.swift

@@ -135,7 +135,7 @@ class NCRecent: NCCollectionViewCommon  {
         dateFormatter.locale = Locale.init(identifier: "en_US_POSIX")
         dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
         let lessDateString = dateFormatter.string(from: Date())
-        let requestBody = String(format: requestBodyRecent, "/files/"+appDelegate.userID, lessDateString)
+        let requestBody = String(format: requestBodyRecent, "/files/"+appDelegate.userId, lessDateString)
         
         isReloadDataSourceNetworkInProgress = true
         collectionView?.reloadData()

+ 2 - 2
iOSClient/Security/NCEndToEndEncryption.h

@@ -30,8 +30,8 @@
 
 + (instancetype)sharedManager;
 
-- (NSString *)createCSR:(NSString *)userID directory:(NSString *)directory;
-- (NSString *)encryptPrivateKey:(NSString *)userID directory: (NSString *)directory passphrase:(NSString *)passphrase privateKey:(NSString **)privateKey;
+- (NSString *)createCSR:(NSString *)userId directory:(NSString *)directory;
+- (NSString *)encryptPrivateKey:(NSString *)userId directory: (NSString *)directory passphrase:(NSString *)passphrase privateKey:(NSString **)privateKey;
 - (NSString *)decryptPrivateKey:(NSString *)privateKeyCipher passphrase:(NSString *)passphrase publicKey:(NSString *)publicKey;
 
 - (NSData *)encryptAsymmetricString:(NSString *)plain publicKey:(NSString *)publicKey privateKey:(NSString *)privateKey;

+ 7 - 7
iOSClient/Security/NCEndToEndEncryption.m

@@ -74,7 +74,7 @@
 #pragma mark - Generate Certificate X509 - CSR - Private Key
 #
 
-- (BOOL)generateCertificateX509WithUserID:(NSString *)userID directory:(NSString *)directory
+- (BOOL)generateCertificateX509WithUserId:(NSString *)userId directory:(NSString *)directory
 {
     OPENSSL_init();
     
@@ -109,10 +109,10 @@
     // Now to add the subject name fields to the certificate
     // I use a macro here to make it cleaner.
     
-    const unsigned char *cUserID = (const unsigned char *) [userID cStringUsingEncoding:NSUTF8StringEncoding];
+    const unsigned char *cUserId = (const unsigned char *) [userId cStringUsingEncoding:NSUTF8StringEncoding];
 
     // Common Name = UserID.
-    addName("CN", cUserID);
+    addName("CN", cUserId);
     
     // The organizational unit for the cert. Usually this is a department.
     addName("OU", "Certificate Authority");
@@ -285,11 +285,11 @@
 #pragma mark - Create CSR & Encrypt/Decrypt Private Key
 #
 
-- (NSString *)createCSR:(NSString *)userID directory:(NSString *)directory
+- (NSString *)createCSR:(NSString *)userId directory:(NSString *)directory
 {
     // Create Certificate, if do not exists
     if (!_csrData) {
-        if (![self generateCertificateX509WithUserID:userID directory:directory])
+        if (![self generateCertificateX509WithUserId:userId directory:directory])
             return nil;
     }
     
@@ -298,12 +298,12 @@
     return csr;
 }
 
-- (NSString *)encryptPrivateKey:(NSString *)userID directory:(NSString *)directory passphrase:(NSString *)passphrase privateKey:(NSString **)privateKey
+- (NSString *)encryptPrivateKey:(NSString *)userId directory:(NSString *)directory passphrase:(NSString *)passphrase privateKey:(NSString **)privateKey
 {
     NSMutableData *privateKeyCipherData = [NSMutableData new];
 
     if (!_privateKeyData) {
-        if (![self generateCertificateX509WithUserID:userID directory:directory])
+        if (![self generateCertificateX509WithUserId:userId directory:directory])
             return nil;
     }
     

+ 2 - 2
iOSClient/Select/NCSelect.swift

@@ -565,13 +565,13 @@ extension NCSelect: UICollectionViewDataSource {
             } else {
                 cell.imageShared.image = NCCollectionCommon.images.cellCanShareImage
             }
-            if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userID {
+            if metadata.ownerId.count > 0 && metadata.ownerId != appDelegate.userId {
                 var fileNameUser = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + metadata.ownerId
                 fileNameUser = fileNameUser + ".png"
                 if FileManager.default.fileExists(atPath: fileNameUser) {
                     cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)
                 } else {
-                    NCCommunication.shared.downloadAvatar(userID: metadata.ownerId, fileNameLocalPath: fileNameUser, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userId: metadata.ownerId, fileNameLocalPath: fileNameUser, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.account {
                             cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)
                         }

+ 1 - 1
iOSClient/Settings/CCManageAccount.m

@@ -445,7 +445,7 @@
     tableAccount *tableAccount = [[NCManageDatabase shared] setAccountActive:account];
     if (tableAccount) {
         
-        [appDelegate settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userID:tableAccount.userID password:[CCUtility getPassword:tableAccount.account]];
+        [appDelegate settingAccount:tableAccount.account urlBase:tableAccount.urlBase user:tableAccount.user userId:tableAccount.userId password:[CCUtility getPassword:tableAccount.account]];
  
         // Init home
         [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:NCBrandGlobal.shared.notificationCenterInitializeMain object:nil userInfo:nil];

+ 2 - 2
iOSClient/Settings/NCEndToEndInitialize.swift

@@ -69,7 +69,7 @@ class NCEndToEndInitialize : NSObject  {
                     NCContentPresenter.shared.messageNotification("E2E get publicKey", description: "bad request: unpredictable internal error", delay: NCBrandGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
                     
                 case NCBrandGlobal.shared.ErrorResourceNotFound:
-                    guard let csr = NCEndToEndEncryption.sharedManager().createCSR(self.appDelegate.userID, directory: CCUtility.getDirectoryUserData()) else {
+                    guard let csr = NCEndToEndEncryption.sharedManager().createCSR(self.appDelegate.userId, directory: CCUtility.getDirectoryUserData()) else {
                         
                         NCContentPresenter.shared.messageNotification("E2E Csr", description: "Error to create Csr", delay: NCBrandGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
                         
@@ -207,7 +207,7 @@ class NCEndToEndInitialize : NSObject  {
                         
                         var privateKeyString: NSString?
                         
-                        guard let privateKeyChiper = NCEndToEndEncryption.sharedManager().encryptPrivateKey(self.appDelegate.userID, directory: CCUtility.getDirectoryUserData(), passphrase: e2ePassphrase, privateKey: &privateKeyString) else {
+                        guard let privateKeyChiper = NCEndToEndEncryption.sharedManager().encryptPrivateKey(self.appDelegate.userId, directory: CCUtility.getDirectoryUserData(), passphrase: e2ePassphrase, privateKey: &privateKeyString) else {
                             
                             NCContentPresenter.shared.messageNotification("E2E privateKey", description: "Serious internal error to create PrivateKey chiper", delay: NCBrandGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
                             

+ 5 - 5
iOSClient/Share/NCShare.swift

@@ -83,7 +83,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
         NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: NSNotification.Name(rawValue: NCBrandGlobal.shared.notificationCenterReloadDataNCShare), object: nil)
         
         // Shared with you by ...
-        if metadata!.ownerId != self.appDelegate.userID {
+        if metadata!.ownerId != self.appDelegate.userId {
             
             searchFieldTopConstraint.constant = 65
             sharedWithYouByView.isHidden = false
@@ -94,7 +94,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
             if FileManager.default.fileExists(atPath: fileNameLocalPath) {
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { sharedWithYouByImage.image = image }
             } else {
-                NCCommunication.shared.downloadAvatar(userID: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                NCCommunication.shared.downloadAvatar(userId: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                     if errorCode == 0 && account == self.appDelegate.account && UIImage(data: data!) != nil {
                         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                             self.sharedWithYouByImage.image = image
@@ -322,7 +322,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
                 }
             } else {
                 DispatchQueue.global().async {
-                    NCCommunication.shared.downloadAvatar(userID: sharee.shareWith, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userId: sharee.shareWith, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && account == self.appDelegate.account && UIImage(data: data!) != nil {
                             if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                 DispatchQueue.main.async {
@@ -419,7 +419,7 @@ extension NCShare: UITableViewDataSource {
                     }
                 } else {
                     DispatchQueue.global().async {
-                        NCCommunication.shared.downloadAvatar(userID: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                        NCCommunication.shared.downloadAvatar(userId: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: NCBrandGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
                             if errorCode == 0 && account == self.appDelegate.account && UIImage(data: data!) != nil {
                                 if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                                     cell.imageItem.avatar()
@@ -437,7 +437,7 @@ extension NCShare: UITableViewDataSource {
                 }
                 
                 // If the initiator or the recipient is not the current user, show the list of sharees without any options to edit it.
-                if tableShare.uidOwner != self.appDelegate.userID && tableShare.uidFileOwner != self.appDelegate.userID {
+                if tableShare.uidOwner != self.appDelegate.userId && tableShare.uidFileOwner != self.appDelegate.userId {
                     cell.isUserInteractionEnabled = false
                     cell.switchCanEdit.isHidden = true
                     cell.labelCanEdit.isHidden = true

+ 2 - 2
iOSClient/Share/NCShareComments.swift

@@ -258,7 +258,7 @@ extension NCShareComments: UITableViewDataSource {
                 if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
             } else {
                 DispatchQueue.global().async {
-                    NCCommunication.shared.downloadAvatar(userID: tableComments.actorId, fileNameLocalPath: fileNameLocalPath, size: 128) { (account, data, errorCode, errorMessage) in
+                    NCCommunication.shared.downloadAvatar(userId: tableComments.actorId, fileNameLocalPath: fileNameLocalPath, size: 128) { (account, data, errorCode, errorMessage) in
                         if errorCode == 0 && UIImage(data: data!) != nil {
                             cell.imageItem.image = UIImage(named: "avatar")
                         }
@@ -289,7 +289,7 @@ extension NCShareComments: UITableViewDataSource {
             cell.labelMessage.text = tableComments.message
             cell.labelMessage.textColor = NCBrandColor.shared.textView
             // Button Menu
-            if tableComments.actorId == appDelegate.userID {
+            if tableComments.actorId == appDelegate.userId {
                 cell.buttonMenu.isHidden = false
             } else {
                 cell.buttonMenu.isHidden = true

+ 4 - 4
iOSClient/Trash/NCTrash.swift

@@ -108,8 +108,8 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         }
                 
         if trashPath == "" {
-            guard let userID = (appDelegate.userID as NSString).addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlFragmentAllowed) else { return }
-            trashPath = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + userID + "/trash/"
+            guard let userId = (appDelegate.userId as NSString).addingPercentEncoding(withAllowedCharacters: NSCharacterSet.urlFragmentAllowed) else { return }
+            trashPath = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + userId + "/trash/"
         }
         reloadDataSource()
     }
@@ -601,7 +601,7 @@ extension NCTrash {
         }
         
         let fileNameFrom = tableTrash.filePath + tableTrash.fileName
-        let fileNameTo = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + appDelegate.userID + "/restore/" + tableTrash.fileName
+        let fileNameTo = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + appDelegate.userId + "/restore/" + tableTrash.fileName
         
         NCCommunication.shared.moveFileOrFolder(serverUrlFileNameSource: fileNameFrom, serverUrlFileNameDestination: fileNameTo, overwrite: true) { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.account {
@@ -617,7 +617,7 @@ extension NCTrash {
     
     func emptyTrash() {
         
-        let serverUrlFileName = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + appDelegate.userID + "/trash"
+        let serverUrlFileName = appDelegate.urlBase + "/" + NCUtilityFileSystem.shared.getDAV() + "/trashbin/" + appDelegate.userId + "/trash"
 
         NCCommunication.shared.deleteFileOrFolder(serverUrlFileName) { (account, errorCode, errorDescription) in
             if errorCode == 0 && account == self.appDelegate.account {