marinofaggiana 4 years ago
parent
commit
e902f36530

+ 1 - 1
iOSClient/CCGlobal.h

@@ -311,7 +311,7 @@
 
 #define k_notificationCenter_initializeMain             @"initializeMain"
 #define k_notificationCenter_setTitleMain               @"setTitleMain"
-#define k_notificationCenter_clearDateReadDataSource    @"clearDateReadDataSource"          // userInfo: serverUrl
+#define k_notificationCenter_clearDateReadDataSource    @"clearDateReadDataSource"          // userInfo: ocId?, serverUrl?
 #define k_notificationCenter_changeTheming              @"changeTheming"
 #define k_notificationCenter_splitViewChangeDisplayMode @"splitViewChangeDisplayMode"
 #define k_notificationCenter_synchronizationMedia       @"synchronizationMedia"             // userInfo: metadata, type

+ 1 - 1
iOSClient/Main/Menu/NCDetailNavigationController+Menu.swift

@@ -149,7 +149,7 @@ extension NCDetailNavigationController {
                         } else {
                             NCManageDatabase.sharedInstance.setLocalFile(ocId: metadata.ocId, offline: !localFile!.offline)
                             NotificationCenter.default.post(name: Notification.Name.init(rawValue:
-                            k_notificationCenter_clearDateReadDataSource), object: nil)
+                                k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
                         }
                     }
                 )

+ 3 - 5
iOSClient/Networking/NCNetworking.swift

@@ -174,7 +174,6 @@ import Alamofire
     @objc func cancelDownload(metadata: tableMetadata) {
         
         guard let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileName) else { return }
-        let serverUlr = metadata.serverUrl
         
         if let request = downloadRequest[fileNameLocalPath] {
             request.cancel()
@@ -189,7 +188,7 @@ import Alamofire
             }
         }
         
-        NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["serverUrl":serverUlr])
+        NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil)
     }
     
     @objc func verifyDownloadRequestLost() {
@@ -267,7 +266,7 @@ import Alamofire
                 
                 if let result = NCManageDatabase.sharedInstance.addMetadata(metadata) { metadata = result }
                 
-                NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["serverUrl":serverUrl])
+                NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
 
             } else {
                 
@@ -295,7 +294,6 @@ import Alamofire
     @objc func cancelUpload(metadata: tableMetadata) {
         
         guard let fileNameLocalPath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileName) else { return }
-        let serverUlr = metadata.serverUrl
         
         if let request = uploadRequest[fileNameLocalPath] {
             request.cancel()
@@ -304,7 +302,7 @@ import Alamofire
             NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
         }
 
-        NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["serverUrl":serverUlr])
+        NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil)
     }
     
     @objc func verifyUploadRequestLost() {

+ 1 - 1
iOSClient/Networking/NCNetworkingNotificationCenter.swift

@@ -167,7 +167,7 @@ import Foundation
                     }
                 }
                 
-                NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["serverUrl":metadata.serverUrl])
+                NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_clearDateReadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
             }
         }
     }