Marino Faggiana 6 роки тому
батько
коміт
70f5421d5e

+ 1 - 1
Picker/DocumentPickerViewController.swift

@@ -310,7 +310,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         metadataNet.action = actionDownloadThumbnail
         metadataNet.fileID = metadata.fileID
         metadataNet.fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: self.serverUrl, activeUrl: activeUrl)
-        metadataNet.options = "m";
+        metadataNet.optionAny = "m";
         metadataNet.selector = selectorDownloadThumbnail;
         metadataNet.serverUrl = self.serverUrl
         

+ 2 - 2
iOSClient/Actions/CCActions.swift

@@ -338,7 +338,7 @@ class CCActions: NSObject {
         metadataNet.fileID = metadata.fileID
         metadataNet.fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)
         metadataNet.fileNameView = metadata.fileNameView
-        metadataNet.options = "m"
+        metadataNet.optionAny = "m"
         metadataNet.priority = Operation.QueuePriority.low.rawValue
         metadataNet.selector = selectorDownloadThumbnail;
         metadataNet.serverUrl = serverUrl;
@@ -367,7 +367,7 @@ class CCActions: NSObject {
         metadataNet.delegate = delegate
         metadataNet.fileID = metadata.fileID
         metadataNet.fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: serverUrl, activeUrl: appDelegate.activeUrl)
-        metadataNet.options = "\(favorite)"
+        metadataNet.optionAny = "\(favorite)"
         metadataNet.selector = selectorAddFavorite
         metadataNet.serverUrl = serverUrl;
         

+ 1 - 1
iOSClient/Favorites/CCFavorites.m

@@ -184,7 +184,7 @@
 {
     if (errorCode == 0) {
         
-        [[NCManageDatabase sharedInstance] setMetadataFavoriteWithFileID:metadataNet.fileID favorite:[metadataNet.options boolValue]];
+        [[NCManageDatabase sharedInstance] setMetadataFavoriteWithFileID:metadataNet.fileID favorite:[metadataNet.optionAny boolValue]];
         [self reloadDatasource];
         
     } else {

+ 2 - 2
iOSClient/Main/CCMain.m

@@ -2578,7 +2578,7 @@
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:appDelegate.activeAccount];
     
     metadataNet.action = actionGetUserAndGroup;
-    metadataNet.options = find;
+    metadataNet.optionAny = find;
     metadataNet.selector = selectorGetUserAndGroup;
         
     [appDelegate addNetworkingOperationQueue:appDelegate.netQueue delegate:self metadataNet:metadataNet];
@@ -2668,7 +2668,7 @@
     
         _dateReadDataSource = nil;
         
-        [[NCManageDatabase sharedInstance] setMetadataFavoriteWithFileID:metadataNet.fileID favorite:[metadataNet.options boolValue]];
+        [[NCManageDatabase sharedInstance] setMetadataFavoriteWithFileID:metadataNet.fileID favorite:[metadataNet.optionAny boolValue]];
         
         if (_isSearchMode)
             [self readFolder:metadataNet.serverUrl];

+ 2 - 2
iOSClient/Networking/CCNetworking.h

@@ -88,7 +88,6 @@
 
 @property (nonatomic, strong) NSString *account;
 @property (nonatomic, strong) NSString *action;
-@property (nonatomic, strong) NSString *assetLocalIdentifier;
 @property (nonatomic, strong) NSArray *contentType;
 @property (nonatomic, strong) NSDate *date;
 @property (nonatomic, weak) id delegate;
@@ -105,7 +104,8 @@
 @property (nonatomic, strong) NSString *fileNameView;
 @property (nonatomic, strong) NSString *key;
 @property (nonatomic, strong) NSString *keyCipher;
-@property (nonatomic, strong) id options;
+@property (nonatomic, strong) id optionAny;
+@property (nonatomic, strong) NSString *optionString;
 @property (nonatomic, strong) NSString *password;
 @property NSInteger priority;
 @property (nonatomic, strong) NSString *serverUrl;

+ 2 - 2
iOSClient/Networking/CCNetworking.m

@@ -1338,7 +1338,6 @@
     
     [metadataNet setAccount: self.account];
     [metadataNet setAction: self.action];
-    [metadataNet setAssetLocalIdentifier: self.assetLocalIdentifier];
     [metadataNet setContentType: self.contentType];
     [metadataNet setDate: self.date];
     [metadataNet setDelegate: self.delegate];
@@ -1355,7 +1354,8 @@
     [metadataNet setFileNameView: self.fileNameView];
     [metadataNet setKey: self.key];
     [metadataNet setKeyCipher: self.keyCipher];
-    [metadataNet setOptions: self.options];
+    [metadataNet setOptionAny: self.optionAny];
+    [metadataNet setOptionString: self.optionString];
     [metadataNet setPassword: self.password];
     [metadataNet setPriority: self.priority];
     [metadataNet setServerUrl: self.serverUrl];

+ 5 - 5
iOSClient/Networking/OCNetworking.m

@@ -275,7 +275,7 @@
 
 - (void)downloadThumbnail
 {
-    [self downloadThumbnailWithDimOfThumbnail:(NSString *)_metadataNet.options fileName:_metadataNet.fileName fileNameLocal:_metadataNet.fileID success:^{
+    [self downloadThumbnailWithDimOfThumbnail:(NSString *)_metadataNet.optionAny fileName:_metadataNet.fileName fileNameLocal:_metadataNet.fileID success:^{
         
         if ([self.delegate respondsToSelector:@selector(downloadThumbnailSuccessFailure:message:errorCode:)])
             [self.delegate downloadThumbnailSuccessFailure:_metadataNet message:nil errorCode:0];
@@ -743,7 +743,7 @@
 
 - (void)settingFavorite
 {
-    [self settingFavorite:_metadataNet.fileName favorite:[_metadataNet.options boolValue] success:^{
+    [self settingFavorite:_metadataNet.fileName favorite:[_metadataNet.optionAny boolValue] success:^{
         
         if ([self.delegate respondsToSelector:@selector(settingFavoriteSuccessFailure:message:errorCode:)])
             [self.delegate settingFavoriteSuccessFailure:_metadataNet message:nil errorCode:0];
@@ -1377,7 +1377,7 @@
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    [communication searchUsersAndGroupsWith:_metadataNet.options forPage:1 with:50 ofServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSArray *itemList, NSString *redirectedServer) {
+    [communication searchUsersAndGroupsWith:_metadataNet.optionAny forPage:1 with:50 ofServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSArray *itemList, NSString *redirectedServer) {
         
         if([self.delegate respondsToSelector:@selector(getUserAndGroupSuccess:items:)])
             [self.delegate getUserAndGroupSuccess:_metadataNet items:itemList];
@@ -1660,7 +1660,7 @@
     [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    NSString *type = _metadataNet.options;
+    NSString *type = _metadataNet.optionAny;
     
     [communication setNotificationServer:_metadataNet.serverUrl type:type onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
         
@@ -1709,7 +1709,7 @@
     communication.kindOfCredential = credentialNotSet;
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    NSDictionary *parameter = _metadataNet.options;
+    NSDictionary *parameter = _metadataNet.optionAny;
     
     NSString *pushToken = [parameter objectForKey:@"pushToken"];
     NSString *pushTokenHash = [parameter objectForKey:@"pushTokenHash"];

+ 6 - 6
iOSClient/Notification/CCNotification.swift

@@ -87,9 +87,9 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
                 let metadataNet = CCMetadataNet.init(account: self.appDelegate.activeAccount)!
                 
                 metadataNet.action = actionSetNotificationServer
-                metadataNet.assetLocalIdentifier = "\(notification.idNotification)"
-                metadataNet.options = "DELETE"
-                metadataNet.serverUrl = "\(self.appDelegate.activeUrl!)/\(k_url_acces_remote_notification_api)/\(metadataNet.assetLocalIdentifier!)"
+                metadataNet.optionString = "\(notification.idNotification)"
+                metadataNet.optionAny = "DELETE"
+                metadataNet.serverUrl = "\(self.appDelegate.activeUrl!)/\(k_url_acces_remote_notification_api)/\(metadataNet.optionString!)"
 
                 self.appDelegate.addNetworkingOperationQueue(self.appDelegate.netQueue, delegate: self, metadataNet: metadataNet)
             }
@@ -116,9 +116,9 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
                             let metadataNet = CCMetadataNet.init(account: self.appDelegate.activeAccount)!
                             
                             metadataNet.action = actionSetNotificationServer
-                            metadataNet.assetLocalIdentifier = "\(notification.idNotification)"
+                            metadataNet.optionString = "\(notification.idNotification)"
                             metadataNet.serverUrl =  (actionNotification as! OCNotificationsAction).link
-                            metadataNet.options = (actionNotification as! OCNotificationsAction).type
+                            metadataNet.optionAny = (actionNotification as! OCNotificationsAction).type
                             
                             self.appDelegate.addNetworkingOperationQueue(self.appDelegate.netQueue, delegate: self, metadataNet: metadataNet)
                         }
@@ -203,7 +203,7 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
             
             let listOfNotifications = appDelegate.listOfNotifications as NSArray as! [OCNotifications]
             
-            if let index = listOfNotifications.index(where: {$0.idNotification == Int(metadataNet.assetLocalIdentifier)})  {
+            if let index = listOfNotifications.index(where: {$0.idNotification == Int(metadataNet.optionString)})  {
                 appDelegate.listOfNotifications.removeObject(at: index)
             }
             

+ 1 - 1
iOSClient/PeekPop/CCPeekPop.m

@@ -132,7 +132,7 @@
     metadataNet.action = actionDownloadThumbnail;
     metadataNet.fileID = metadata.fileID;
     metadataNet.fileName = [self returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl];
-    metadataNet.options = @"l";
+    metadataNet.optionAny = @"l";
     metadataNet.priority = NSOperationQueuePriorityLow;
     metadataNet.selector = selectorDownloadThumbnail;
     metadataNet.serverUrl = serverUrl;