Browse Source

Change name : setNotificationServer

Marino Faggiana 8 năm trước cách đây
mục cha
commit
f3e5d32366

+ 2 - 2
Libraries external/OCCommunicationLib/OCCommunicationLib/OCCommunication.h

@@ -782,7 +782,7 @@ typedef enum {
 
 
 ///-----------------------------------
-/// @name set Notification
+/// @name set server Notification
 ///-----------------------------------
 
 /**
@@ -794,7 +794,7 @@ typedef enum {
  *
  */
 
-- (void) setNotification:(NSString*)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
+- (void) setNotificationServer:(NSString*)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 @end
 

+ 2 - 2
Libraries external/OCCommunicationLib/OCCommunicationLib/OCCommunication.m

@@ -1380,14 +1380,14 @@
     }];
 }
 
-- (void) setNotification:(NSString*)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void (^)(NSHTTPURLResponse *, NSString *))successRequest failureRequest:(void (^)(NSHTTPURLResponse *, NSError *, NSString *))failureRequest {
+- (void) setNotificationServer:(NSString*)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void (^)(NSHTTPURLResponse *, NSString *))successRequest failureRequest:(void (^)(NSHTTPURLResponse *, NSError *, NSString *))failureRequest {
     
     serverPath = [serverPath encodeString:NSUTF8StringEncoding];
     
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];
     
-    [request setNotification:serverPath type:type onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
+    [request setNotificationServer:serverPath type:type onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
         if (successRequest) {
             //Return success
             successRequest(response, request.redirectedServer);

+ 2 - 2
Libraries external/OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.h

@@ -485,7 +485,7 @@ extern NSString * _Nullable OCWebDAVModificationDateKey;
 - (void) getNotificationsOfServer:(NSString * _Nonnull)serverPath onCommunication:(OCCommunication * _Nonnull)sharedOCComunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id _Nonnull response))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull operation, id  _Nullable responseObject, NSError * _Nonnull error))failure;
 
 ///-----------------------------------
-/// @name Delete Notification
+/// @name set server Notification
 ///-----------------------------------
 
 /**
@@ -497,6 +497,6 @@ extern NSString * _Nullable OCWebDAVModificationDateKey;
  *
  */
 
-- (void)setNotification:(NSString * _Nonnull)serverPath type:(NSString * _Nonnull)type onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id  _Nullable responseObject, NSError * _Nonnull))failure;
+- (void)setNotificationServer:(NSString * _Nonnull)serverPath type:(NSString * _Nonnull)type onCommunication:(OCCommunication * _Nonnull)sharedOCCommunication success:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id _Nonnull))success failure:(void(^ _Nonnull)(NSHTTPURLResponse * _Nonnull, id  _Nullable responseObject, NSError * _Nonnull))failure;
 
 @end

+ 1 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -637,7 +637,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
     [operation resume];
 }
 
-- (void) setNotification:(NSString *)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *, id))success failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
+- (void) setNotificationServer:(NSString *)serverPath type:(NSString *)type onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *, id))success failure:(void(^)(NSHTTPURLResponse *, id  _Nullable responseObject, NSError *))failure {
     
     NSParameterAssert(success);
     

+ 1 - 1
Picker/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>

+ 1 - 1
PickerFileProvider/Info.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.17</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
Share Ext/Info.plist

@@ -21,7 +21,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/CCGlobal.h

@@ -262,7 +262,7 @@ extern NSString *const BKPasscodeKeychainServiceName;
 #define actionGetFeaturesSuppServer     @"getFeaturesSupportedByServer"
 #define actionGetUserAndGroup           @"getUserAndGroup"
 #define actionGetNotificationsOfServer  @"getNotificationsOfServer"
-#define actionSetNotification           @"setNotification"
+#define actionSetNotificationServer     @"setNotificationServer"
 #define actionMoveFileOrFolder          @"moveFileOrFolder"
 #define actionReadFile                  @"readFile"
 #define actionReadFolder                @"readFolder"

+ 1 - 1
iOSClient/Info.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00006</string>
+	<string>00007</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<true/>
 	<key>ITSEncryptionExportComplianceCode</key>

+ 9 - 11
iOSClient/Main/CCMain.m

@@ -1038,9 +1038,10 @@
                         
                         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
                         
-                        metadataNet.action  = actionSetNotification;
-                        metadataNet.serverUrl =  [NSString stringWithFormat:@"%@/%@/%@", app.activeUrl, k_url_acces_remote_notification_api, idNotification];
+                        metadataNet.action  = actionSetNotificationServer;
+                        metadataNet.identifier = idNotification;
                         metadataNet.options = @"DELETE";
+                        metadataNet.serverUrl =  [NSString stringWithFormat:@"%@/%@/%@", app.activeUrl, k_url_acces_remote_notification_api, idNotification];
                         
                         [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
                     }
@@ -1062,33 +1063,30 @@
                 for (OCNotificationsAction *action in notification.actions)
                     if ([action.label isEqualToString:buttonTitle]) {
                         
-                        /*
                         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
                         
-                        metadataNet.action  = actionSetNotification;
+                        metadataNet.action  = actionSetNotificationServer;
+                        metadataNet.identifier = idNotification;
                         metadataNet.serverUrl =  action.link;
                         metadataNet.options = action.type;
                         
                         [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
-                        */ 
                     }
             }];
         }
     }
 }
 
-- (void)setNotificationSuccess:(CCMetadataNet *)metadataNet
+- (void)setNotificationServerSuccess:(CCMetadataNet *)metadataNet
 {
     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
-    NSString *idNotification = metadataNet.options;
-    
-    [appDelegate.listOfNotifications removeObjectForKey:idNotification];
+    [appDelegate.listOfNotifications removeObjectForKey:metadataNet.identifier];
     
-    NSLog(@"delete Notification id :%@", idNotification);
+    NSLog(@"delete Notification id :%@", metadataNet.identifier);
 }
 
-- (void)setNotificationFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
+- (void)setNotificationServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
     NSLog(@"Error Notification");
 }

+ 2 - 2
iOSClient/Networking/OCNetworking.h

@@ -96,8 +96,8 @@
 - (void)getNotificationsOfServerSuccess:(NSArray *)listOfNotifications;
 - (void)getNotificationsOfServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 
-- (void)setNotificationSuccess:(CCMetadataNet *)metadataNet;
-- (void)setNotificationFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
+- (void)setNotificationServerSuccess:(CCMetadataNet *)metadataNet;
+- (void)setNotificationServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 
 // HUD
 - (void)progressTask:(NSString *)fileID serverUrl:(NSString *)serverUrl cryptated:(BOOL)cryptated progress:(float)progress;

+ 6 - 6
iOSClient/Networking/OCNetworking.m

@@ -966,7 +966,7 @@
     }];
 }
 
-- (void)setNotification
+- (void)setNotificationServer
 {
     OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
     
@@ -975,10 +975,10 @@
     
     NSString *type = _metadataNet.options;
     
-    [communication setNotification:_metadataNet.serverUrl type:type onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
+    [communication setNotificationServer:_metadataNet.serverUrl type:type onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
         
-        if ([self.delegate respondsToSelector:@selector(setNotificationSuccess:)])
-            [self.delegate setNotificationSuccess:_metadataNet];
+        if ([self.delegate respondsToSelector:@selector(setNotificationServerSuccess:)])
+            [self.delegate setNotificationServerSuccess:_metadataNet];
         
         [self complete];
         
@@ -988,8 +988,8 @@
         if (errorCode == 0)
             errorCode = error.code;
         
-        if([self.delegate respondsToSelector:@selector(setNotificationFailure:message:errorCode:)])
-            [self.delegate setNotificationFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
+        if([self.delegate respondsToSelector:@selector(setNotificationServerFailure:message:errorCode:)])
+            [self.delegate setNotificationServerFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
         
         // Request trusted certificated
         if ([error code] == NSURLErrorServerCertificateUntrusted)