|
@@ -173,6 +173,7 @@ import Alamofire
|
|
|
} catch { }
|
|
|
}
|
|
|
|
|
|
+ NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
|
|
|
self.NotificationPost(name: k_notificationCenter_deleteFile, serverUrl: metadata.serverUrl, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
|
|
|
}
|
|
|
}
|
|
@@ -236,6 +237,8 @@ import Alamofire
|
|
|
metadata.session = NCCommunicationCommon.shared.sessionIdentifierUpload
|
|
|
if let result = NCManageDatabase.sharedInstance.addMetadata(metadata) { metadata = result }
|
|
|
|
|
|
+ NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
|
|
|
+
|
|
|
NCCommunication.shared.upload(serverUrlFileName: serverUrlFileName, fileNameLocalPath: fileNameLocalPath, dateCreationFile: metadata.date as Date, dateModificationFile: metadata.date as Date, addCustomHeaders: ["e2e-token":e2eToken!], requestHandler: { (request) in
|
|
|
|
|
|
NCNetworking.shared.uploadRequest[fileNameLocalPath] = request
|
|
@@ -276,9 +279,7 @@ import Alamofire
|
|
|
|
|
|
CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
|
|
|
NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
-
|
|
|
- NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["serverUrl":serverUrl])
|
|
|
-
|
|
|
+
|
|
|
} else if errorCode == 401 || errorCode == 403 {
|
|
|
|
|
|
NCNetworkingCheckRemoteUser.shared.checkRemoteUser(account: metadata.account)
|
|
@@ -286,7 +287,6 @@ import Alamofire
|
|
|
CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
|
|
|
NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
|
|
|
- NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["serverUrl":serverUrl])
|
|
|
|
|
|
} else if errorCode == Int(CFNetworkErrors.cfurlErrorServerCertificateUntrusted.rawValue) {
|
|
|
|
|
@@ -294,9 +294,7 @@ import Alamofire
|
|
|
|
|
|
CCUtility.removeFile(atPath: CCUtility.getDirectoryProviderStorageOcId(metadata.ocId))
|
|
|
NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "ocId == %@", metadata.ocId))
|
|
|
-
|
|
|
- NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["serverUrl":serverUrl])
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
metadata.session = ""
|
|
@@ -309,6 +307,8 @@ import Alamofire
|
|
|
}
|
|
|
|
|
|
NCNetworkingE2EE.shared.unlock(account: metadata.account, serverUrl: serverUrl) { (_, _, _, _) in }
|
|
|
+
|
|
|
+ NotificationCenter.default.post(name: Notification.Name.init(rawValue: k_notificationCenter_reloadDataSource), object: nil, userInfo: ["ocId":metadata.ocId,"serverUrl":metadata.serverUrl])
|
|
|
}
|
|
|
|
|
|
} else {
|