Ver código fonte

update NCCommunication

marinofaggiana 5 anos atrás
pai
commit
ebdb3ac92d

+ 1 - 1
Cartfile.resolved

@@ -16,7 +16,7 @@ github "krzyzanowskim/OpenSSL" "1.0.218"
 github "malcommac/SwiftRichString" "3.0.3"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
-github "nextcloud/ios-communication-library" "b672b927586177e97e1ec1bea99223c19164313d"
+github "nextcloud/ios-communication-library" "5a8760c4df477c2ed8b76a4b76e5d77aed4bb2d9"
 github "realm/realm-cocoa" "v3.17.3"
 github "rechsteiner/Parchment" "v1.7.0"
 github "tilltue/TLPhotoPicker" "1.9.3"

+ 2 - 1
Share/ShareViewController.m

@@ -213,7 +213,7 @@
         
         (void)[[NCCommunication sharedInstance] uploadWithServerUrlFileName:fileNameServer fileNameLocalPath:fileNameLocal dateCreationFile:nil dateModificationFile:nil account:self.activeAccount progressHandler:^(NSProgress * progress) {
             [self.hud progress:progress.fractionCompleted];
-        } completionHandler:^(NSString *account, NSString *ocId, NSString *etag, NSDate *date, NSString *contentType, int64_t size, NSInteger errorCode, NSString *errorDescription) {
+        } completionHandler:^(NSString *account, NSString *ocId, NSString *etag, NSDate *date, int64_t size, NSInteger errorCode, NSString *errorDescription) {
             [self.hud hideHud];
             [self.filesName removeObject:fileName];
            
@@ -230,6 +230,7 @@
                 metadata.fileName = fileNameForUpload;
                 metadata.fileNameView = fileNameForUpload;
                 metadata.serverUrl = self.serverUrl;
+                metadata.size = size;
                 (void)[CCUtility insertTypeFileIconName:fileNameForUpload metadata:metadata];
                
                 metadata = [[NCManageDatabase sharedInstance] addMetadata:metadata];

+ 3 - 3
iOSClient/Networking/NCNetworking.swift

@@ -29,7 +29,7 @@ import NCCommunication
     @objc optional func downloadProgress(_ progress: Double, fileName: String, ServerUrl: String, session: URLSession, task: URLSessionTask)
     @objc optional func uploadProgress(_ progress: Double, fileName: String, ServerUrl: String, session: URLSession, task: URLSessionTask)
     @objc optional func downloadComplete(fileName: String, serverUrl: String, etag: String?, date: NSDate?, dateLastModified: NSDate?, length: Double, description: String?, error: Error?, statusCode: Int)
-    @objc optional func uploadComplete(fileName: String, serverUrl: String, ocId: String?, etag: String?, date: NSDate?, contentType: String?, size: Int64, description: String?, error: Error?, statusCode: Int)
+    @objc optional func uploadComplete(fileName: String, serverUrl: String, ocId: String?, etag: String?, date: NSDate?, size: Int64, description: String?, error: Error?, statusCode: Int)
 }
 
 @objc class NCNetworking: NSObject, NCCommunicationCommonDelegate {
@@ -68,8 +68,8 @@ import NCCommunication
         delegate?.uploadProgress?(progress, fileName: fileName, ServerUrl: ServerUrl, session: session, task: task)
     }
     
-    func uploadComplete(fileName: String, serverUrl: String, ocId: String?, etag: String?, date: NSDate?, contentType: String?, size: Int64 ,description: String?, error: Error?, statusCode: Int) {
-        delegate?.uploadComplete?(fileName: fileName, serverUrl: serverUrl, ocId: ocId, etag: etag, date: date, contentType: contentType, size:size, description: description, error: error, statusCode: statusCode)
+    func uploadComplete(fileName: String, serverUrl: String, ocId: String?, etag: String?, date: NSDate?, size: Int64 ,description: String?, error: Error?, statusCode: Int) {
+        delegate?.uploadComplete?(fileName: fileName, serverUrl: serverUrl, ocId: ocId, etag: etag, date: date, size:size, description: description, error: error, statusCode: statusCode)
     }
     
     func downloadComplete(fileName: String, serverUrl: String, etag: String?, date: NSDate?, dateLastModified: NSDate?, length: Double, description: String?, error: Error?, statusCode: Int) {