Эх сурвалжийг харах

Rename NCUserBaseUrl.userUrlBase

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 жил өмнө
parent
commit
004a2e2af8

+ 1 - 1
Share/NCShareExtension.swift

@@ -266,7 +266,7 @@ class NCShareExtension: UIViewController, NCListCellDelegate, NCEmptyDataSetDele
         let image = NCUtility.shared.loadUserImage(
             for: activeAccount.user,
                displayName: activeAccount.displayName,
-               userUrlBase: activeAccount)
+               userBaseUrl: activeAccount)
 
         let profileButton = UIButton(type: .custom)
         profileButton.setImage(image, for: .normal)

+ 3 - 3
iOSClient/Activity/NCActivity.swift

@@ -93,7 +93,7 @@ class NCActivity: UIViewController {
             return
         }
         
-        let fileName = appDelegate.userUrlBase + "-" + appDelegate.user + ".png"
+        let fileName = appDelegate.userBaseUrl + "-" + appDelegate.user + ".png"
         let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
         if let image = UIImage(contentsOfFile: fileNameLocalPath) {
             imageItem.image = image
@@ -248,7 +248,7 @@ extension NCActivity: UITableViewDataSource {
         cell.sizeToFit()
         
         // Image
-        let fileName = appDelegate.userUrlBase + "-" + comment.actorId + ".png"
+        let fileName = appDelegate.userBaseUrl + "-" + comment.actorId + ".png"
         NCOperationQueue.shared.downloadAvatar(user: comment.actorId, dispalyName: comment.actorDisplayName, fileName: fileName, cell: cell, view: tableView)
         // Username
         cell.labelUser.text = comment.actorDisplayName
@@ -313,7 +313,7 @@ extension NCActivity: UITableViewDataSource {
             cell.avatar.isHidden = false
             cell.fileUser = activity.user
             
-            let fileName = appDelegate.userUrlBase + "-" + activity.user + ".png"
+            let fileName = appDelegate.userBaseUrl + "-" + activity.user + ".png"
             
             NCOperationQueue.shared.downloadAvatar(user: activity.user, dispalyName: nil, fileName: fileName, cell: cell, view: tableView)
         }

+ 1 - 1
iOSClient/Main/Account Request/NCAccountRequest.swift

@@ -239,7 +239,7 @@ extension NCAccountRequest: UITableViewDataSource {
             avatarImage?.image = NCUtility.shared.loadUserImage(
                 for: account.user,
                    displayName: account.displayName,
-                   userUrlBase: account)
+                   userBaseUrl: account)
 
             if account.alias != "" {
                 userLabel?.text = account.alias.uppercased()

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

@@ -602,7 +602,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
                 let image = NCUtility.shared.loadUserImage(
                     for: appDelegate.user,
                        displayName: activeAccount?.displayName,
-                       userUrlBase: appDelegate)
+                       userBaseUrl: appDelegate)
 
                 let button = UIButton(type: .custom)
                 button.setImage(image, for: .normal)
@@ -1341,7 +1341,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
            metadata.ownerId != appDelegate.userId,
            appDelegate.account == metadata.account,
            let cell = cell as? NCCellProtocol {
-            let fileName = metadata.userUrlBase + "-" + metadata.ownerId + ".png"
+            let fileName = metadata.userBaseUrl + "-" + metadata.ownerId + ".png"
             NCOperationQueue.shared.downloadAvatar(user: metadata.ownerId, dispalyName: metadata.ownerDisplayName, fileName: fileName, cell: cell, view: collectionView)
         }
     }

+ 1 - 1
iOSClient/Menu/NCLoginWeb+Menu.swift

@@ -40,7 +40,7 @@ extension NCLoginWeb {
             avatar = NCUtility.shared.loadUserImage(
                 for: account.user,
                    displayName: account.displayName,
-                   userUrlBase: account)
+                   userBaseUrl: account)
 
             actions.append(
                 NCMenuAction(

+ 1 - 1
iOSClient/Menu/UIViewController+Menu.swift

@@ -71,7 +71,7 @@ extension UIViewController {
                 icon: NCUtility.shared.loadUserImage(
                     for: userId,
                        displayName: card.displayName,
-                       userUrlBase: appDelegate),
+                       userBaseUrl: appDelegate),
                 action: nil)
 
             let actions = card.actions.map { action -> NCMenuAction in

+ 1 - 1
iOSClient/More/NCMore.swift

@@ -327,7 +327,7 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
                 cell.avatar.image = NCUtility.shared.loadUserImage(
                     for: account.user,
                        displayName: account.displayName,
-                       userUrlBase: appDelegate)
+                       userBaseUrl: appDelegate)
 
                 if account.alias == "" {
                     cell.displayName?.text = account.displayName

+ 1 - 1
iOSClient/Networking/NCOperationQueue.swift

@@ -174,7 +174,7 @@ import NCCommunication
             cell.fileAvatarImageView?.image = NCUtility.shared.loadUserImage(
                 for: user,
                    displayName: dispalyName,
-                   userUrlBase: account)
+                   userBaseUrl: account)
         }
 
         for operation in downloadAvatarQueue.operations as! [NCOperationDownloadAvatar] {

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -102,7 +102,7 @@ class NCService: NSObject {
                 self.synchronizeOffline(account: tableAccount.account)
 
                 // Get Avatar
-                let fileName = tableAccount.userUrlBase + "-" + self.appDelegate.user + ".png"
+                let fileName = tableAccount.userBaseUrl + "-" + self.appDelegate.user + ".png"
                 let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
                 let etag = NCManageDatabase.shared.getTableAvatar(fileName: fileName)?.etag
 

+ 1 - 1
iOSClient/Notification/NCNotification.swift

@@ -137,7 +137,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
             if let json = JSON(subjectRichParameters).dictionary {
                 if let user = json["user"]?["id"].stringValue {
                     
-                    let fileName = appDelegate.userUrlBase + "-" + user + ".png"
+                    let fileName = appDelegate.userBaseUrl + "-" + user + ".png"
                     let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
                     
                     if FileManager.default.fileExists(atPath: fileNameLocalPath) {

+ 1 - 1
iOSClient/Select/NCSelect.swift

@@ -419,7 +419,7 @@ extension NCSelect: UICollectionViewDataSource {
            metadata.ownerId != activeAccount.userId,
            activeAccount.account == metadata.account,
            let cell = cell as? NCCellProtocol {
-            let fileName = metadata.userUrlBase + "-" + metadata.ownerId + ".png"
+            let fileName = metadata.userBaseUrl + "-" + metadata.ownerId + ".png"
             NCOperationQueue.shared.downloadAvatar(user: metadata.ownerId, dispalyName: metadata.ownerDisplayName, fileName: fileName, cell: cell, view: collectionView)
         }
     }

+ 1 - 1
iOSClient/Settings/CCManageAccount.m

@@ -56,7 +56,7 @@
         row = [XLFormRowDescriptor formRowDescriptorWithTag:account.account rowType:XLFormRowDescriptorTypeBooleanCheck title:title];
         
         // Avatar
-        UIImage *avatar = [[NCUtility shared] loadUserImageFor:account.user displayName:account.displayName userUrlBase:account];
+        UIImage *avatar = [[NCUtility shared] loadUserImageFor:account.user displayName:account.displayName userBaseUrl:account];
         
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.secondarySystemGroupedBackground;
         [row.cellConfig setObject:[UIFont systemFontOfSize:13.0] forKey:@"textLabel.font"];

+ 5 - 5
iOSClient/Share/NCShare.swift

@@ -101,7 +101,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareNetworkingD
             sharedWithYouByImage.image = NCUtility.shared.loadUserImage(
                 for: metadata.ownerId,
                    displayName: metadata.ownerDisplayName,
-                   userUrlBase: appDelegate)
+                   userBaseUrl: appDelegate)
             let shareAction = UITapGestureRecognizer(target: self, action: #selector(openShareProfile))
             sharedWithYouByImage.addGestureRecognizer(shareAction)
             let shareLabelAction = UITapGestureRecognizer(target: self, action: #selector(openShareProfile))
@@ -121,7 +121,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareNetworkingD
             }
             
 
-            let fileName = appDelegate.userUrlBase + "-" + metadata.ownerId + ".png"
+            let fileName = appDelegate.userBaseUrl + "-" + metadata.ownerId + ".png"
 
             if NCManageDatabase.shared.getImageAvatarLoaded(fileName: fileName) == nil {
                 let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
@@ -333,9 +333,9 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareNetworkingD
             cell.imageItem.image = NCUtility.shared.loadUserImage(
                 for: sharee.shareWith,
                    displayName: nil,
-                   userUrlBase: self.appDelegate)
+                   userBaseUrl: self.appDelegate)
 
-            let fileName = self.appDelegate.userUrlBase + "-" + sharee.shareWith + ".png"
+            let fileName = self.appDelegate.userBaseUrl + "-" + sharee.shareWith + ".png"
             if NCManageDatabase.shared.getImageAvatarLoaded(fileName: fileName) == nil {
                 let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
                 let etag = NCManageDatabase.shared.getTableAvatar(fileName: fileName)?.etag
@@ -428,7 +428,7 @@ extension NCShare: UITableViewDataSource {
                 cell.imageStatus.image = status.onlineStatus
                 cell.status.text = status.statusMessage
                 
-                let fileName = appDelegate.userUrlBase + "-" + tableShare.shareWith + ".png"
+                let fileName = appDelegate.userBaseUrl + "-" + tableShare.shareWith + ".png"
                
                 NCOperationQueue.shared.downloadAvatar(user: tableShare.shareWith, dispalyName: tableShare.shareWithDisplayname, fileName: fileName, cell: cell, view: tableView)
                 

+ 1 - 1
iOSClient/Utility/NCUserBaseUrl.swift

@@ -29,7 +29,7 @@ import Foundation
 }
 
 public extension NCUserBaseUrl {
-    var userUrlBase: String {
+    var userBaseUrl: String {
         user + "-" + (URL(string: urlBase)?.host ?? "")
     }
 }

+ 2 - 2
iOSClient/Utility/NCUtility.swift

@@ -499,9 +499,9 @@ class NCUtility: NSObject {
         return  UIImage(named: "file")!.image(color: color, size: size)
     }
     
-    @objc func loadUserImage(for user: String, displayName: String?, userUrlBase: NCUserBaseUrl) -> UIImage {
+    @objc func loadUserImage(for user: String, displayName: String?, userBaseUrl: NCUserBaseUrl) -> UIImage {
 
-        let fileName = userUrlBase.userUrlBase + "-" + user + ".png"
+        let fileName = userBaseUrl.userBaseUrl + "-" + user + ".png"
         let localFilePath = String(CCUtility.getDirectoryUserData()) + "/" + fileName
 
         if let localImage = UIImage(contentsOfFile: localFilePath) {