marinofaggiana %!s(int64=4) %!d(string=hai) anos
pai
achega
ff4771308f

+ 1 - 2
iOSClient/Activity/NCActivity.swift

@@ -222,8 +222,7 @@ extension NCActivity: UITableViewDataSource {
                 cell.subjectTrailingConstraint.constant = 50
                 cell.subjectTrailingConstraint.constant = 50
                 cell.avatar.isHidden = false
                 cell.avatar.isHidden = false
                 
                 
-                var fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + activity.user
-                fileNameLocalPath = fileNameLocalPath + ".png"
+                let fileNameLocalPath = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase)) + "-" + activity.user + ".png"
                 if FileManager.default.fileExists(atPath: fileNameLocalPath) {
                 if FileManager.default.fileExists(atPath: fileNameLocalPath) {
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                     if let image = UIImage(contentsOfFile: fileNameLocalPath) {
                         cell.avatar.image = image
                         cell.avatar.image = image

+ 6 - 17
iOSClient/Main/Account Request/NCAccountRequest.swift

@@ -151,7 +151,6 @@ extension NCAccountRequest: UITableViewDataSource {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        
         let account = accounts[indexPath.row]
         let account = accounts[indexPath.row]
-        var avatar = UIImage(named: "avatarCredentials")
         let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
         let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
         cell.backgroundColor = NCBrandColor.shared.backgroundForm
         cell.backgroundColor = NCBrandColor.shared.backgroundForm
        
        
@@ -161,24 +160,14 @@ extension NCAccountRequest: UITableViewDataSource {
         let activeImage = cell.viewWithTag(40) as? UIImageView
         let activeImage = cell.viewWithTag(40) as? UIImageView
         
         
         avatarImage?.image = UIImage(named: "avatarCredentials")
         avatarImage?.image = UIImage(named: "avatarCredentials")
+    
+        let fileNamePath = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(account.user, urlBase: account.urlBase)) + "-" + account.user + ".png"
         
         
-        var fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(account.user, urlBase: account.urlBase) + "-" + account.user
-        fileNamePath = fileNamePath + ".png"
-
-        if var userImage = UIImage(contentsOfFile: fileNamePath) {
-            userImage = userImage.resizeImage(size: CGSize(width: 50, height: 50), isAspectRation: true)!
-            let userImageView = UIImageView(image: userImage)
-            userImageView.avatar(roundness: 2, borderWidth: 1, borderColor: NCBrandColor.shared.avatarBorder, backgroundColor: .clear)
-            UIGraphicsBeginImageContext(userImageView.bounds.size)
-            userImageView.layer.render(in: UIGraphicsGetCurrentContext()!)
-            if let newAvatar = UIGraphicsGetImageFromCurrentImageContext() {
-                avatar = newAvatar
-            }
-            UIGraphicsEndImageContext()
+        if let userImage = UIImage(contentsOfFile: fileNamePath) {
+            avatarImage?.avatar(roundness: 2, borderWidth: 1, borderColor: NCBrandColor.shared.avatarBorder, backgroundColor: .clear)
+            avatarImage?.image = userImage
         }
         }
-        
-        avatarImage?.image = avatar
-        
+                
         userLabel?.text = account.user.uppercased()
         userLabel?.text = account.user.uppercased()
         urlLabel?.text = (URL(string: account.urlBase)?.host ?? "")
         urlLabel?.text = (URL(string: account.urlBase)?.host ?? "")
 
 

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

@@ -36,8 +36,7 @@ extension NCLoginWeb {
         for account in accounts {
         for account in accounts {
             
             
             let title = account.user + " " + (URL(string: account.urlBase)?.host ?? "")
             let title = account.user + " " + (URL(string: account.urlBase)?.host ?? "")
-            var fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(account.user, urlBase: account.urlBase) + "-" + account.user
-            fileNamePath = fileNamePath + ".png"
+            let fileNamePath = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(account.user, urlBase: account.urlBase)) + "-" + account.user + ".png"
 
 
             if var userImage = UIImage(contentsOfFile: fileNamePath) {
             if var userImage = UIImage(contentsOfFile: fileNamePath) {
                 userImage = userImage.resizeImage(size: CGSize(width: 50, height: 50), isAspectRation: true)!
                 userImage = userImage.resizeImage(size: CGSize(width: 50, height: 50), isAspectRation: true)!

+ 1 - 2
iOSClient/More/NCMore.swift

@@ -327,8 +327,7 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             cell.status.text = ""
             cell.status.text = ""
             cell.displayName.text = ""
             cell.displayName.text = ""
             
             
-            var fileNamePath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase) + "-" + appDelegate.user
-            fileNamePath = fileNamePath + ".png"
+            let fileNamePath = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(appDelegate.user, urlBase: appDelegate.urlBase)) + "-" + appDelegate.user + ".png"
             
             
             if let themingAvatarFile = UIImage.init(contentsOfFile: fileNamePath) {
             if let themingAvatarFile = UIImage.init(contentsOfFile: fileNamePath) {
                 cell.avatar?.image = themingAvatarFile
                 cell.avatar?.image = themingAvatarFile