marinofaggiana 3 年 前
コミット
58e63b0eeb

+ 1 - 1
iOSClient/Activity/NCActivity.swift

@@ -611,7 +611,7 @@ extension NCActivity {
             
             NCUtility.shared.stopActivityIndicator()
             
-            if errorCode == 304 {
+            if errorCode == NCGlobal.shared.errorNotModified {
                 self.canFetchActivity = false
             } else {
                 self.canFetchActivity = true

+ 1 - 0
iOSClient/NCGlobal.swift

@@ -180,6 +180,7 @@ class NCGlobal: NSObject {
     // Error
     //
     @objc let errorRequestExplicityCancelled: Int   = 15
+    @objc let errorNotModified: Int                 = 304
     @objc let errorBadRequest: Int                  = 400
     @objc let errorResourceNotFound: Int            = 404
     @objc let errordMethodNotSupported: Int         = 405

+ 1 - 1
iOSClient/Networking/NCOperationQueue.swift

@@ -491,7 +491,7 @@ class NCOperationDownloadAvatar: ConcurrentOperation {
                             (self.view as? UITableView)?.reloadData()
                         }
                     }
-                } else if errorCode == 304, var image = UIImage(contentsOfFile: self.fileNameLocalPath) {
+                } else if errorCode == NCGlobal.shared.errorNotModified, var image = UIImage(contentsOfFile: self.fileNameLocalPath) {
                     image = NCUtility.shared.createAvatar(image: image, size: 30)
                     #if !EXTENSION
                     (UIApplication.shared.delegate as! AppDelegate).avatars[self.user] = image

+ 1 - 1
iOSClient/Networking/NCService.swift

@@ -116,7 +116,7 @@ class NCService: NSObject {
                             (UIApplication.shared.delegate as! AppDelegate).avatars[user] = image
                             NCManageDatabase.shared.addAvatar(fileName: fileName, etag: etag)
                             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadAvatar, userInfo: nil)
-                        } else if errorCode == 304, var image = UIImage(contentsOfFile: fileNameLocalPath) {
+                        } else if errorCode == NCGlobal.shared.errorNotModified, var image = UIImage(contentsOfFile: fileNameLocalPath) {
                             image = NCUtility.shared.createAvatar(image: image, size: 30)
                             (UIApplication.shared.delegate as! AppDelegate).avatars[user] = image
                             NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadAvatar, userInfo: nil)

+ 2 - 2
iOSClient/Share/NCShare.swift

@@ -110,7 +110,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
                         (UIApplication.shared.delegate as! AppDelegate).avatars[self.metadata!.ownerId] = image
                         NCManageDatabase.shared.addAvatar(fileName: fileName, etag: etag)
                         self.sharedWithYouByImage.image = image
-                    } else if errorCode == 304, var image = UIImage(contentsOfFile: fileNameLocalPath) {
+                    } else if errorCode == NCGlobal.shared.errorNotModified, var image = UIImage(contentsOfFile: fileNameLocalPath) {
                         image = NCUtility.shared.createAvatar(image: image, size: 30)
                         (UIApplication.shared.delegate as! AppDelegate).avatars[self.metadata!.ownerId] = image
                         self.sharedWithYouByImage.image = image
@@ -355,7 +355,7 @@ class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDel
                         self.appDelegate.avatars[sharee.shareWith] = image
                         NCManageDatabase.shared.addAvatar(fileName: fileName, etag: etag)
                         cell.imageItem.image = image
-                    } else if errorCode == 304, var image = UIImage(contentsOfFile: fileNameLocalPath) {
+                    } else if errorCode == NCGlobal.shared.errorNotModified, var image = UIImage(contentsOfFile: fileNameLocalPath) {
                         image = NCUtility.shared.createAvatar(image: image, size: 30)
                         self.appDelegate.avatars[sharee.shareWith] = image
                         cell.imageItem.image = image