Marino Faggiana 8 years ago
parent
commit
ed495df490

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

@@ -22,6 +22,12 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 //
+//
+//  Add : getNotificationServer & setNotificationServer
+//  Add : getUserProfileServer
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
 
 #import <Foundation/Foundation.h>
 
@@ -779,7 +785,7 @@ typedef enum {
  *
  */
 
-- (void) getNotificationsOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
+- (void) getNotificationServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 
 ///-----------------------------------
@@ -812,7 +818,7 @@ typedef enum {
  *
  */
 
-- (void) getUserProfileOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
+- (void) getUserProfileServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest;
 
 @end
 

+ 55 - 7
Libraries external/OCCommunicationLib/OCCommunicationLib/OCCommunication.m

@@ -22,6 +22,13 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 //
+//
+//  Add : getNotificationServer & setNotificationServer
+//  Add : getUserProfileServer
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+
 
 #import "OCCommunication.h"
 #import "OCHTTPRequestOperation.h"
@@ -40,6 +47,7 @@
 #import "OCNotifications.h"
 #import "OCNotificationsAction.h"
 #import "OCRichObjectStrings.h"
+#import "OCUserProfile.h"
 
 @interface OCCommunication ()
 
@@ -1287,7 +1295,7 @@
 
 #pragma mark - Notification Server
 
-- (void) getNotificationsOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
+- (void) getNotificationServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
     
     serverPath = [serverPath encodeString:NSUTF8StringEncoding];
     serverPath = [serverPath stringByAppendingString:k_url_acces_remote_notification_api];
@@ -1295,7 +1303,7 @@
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];
     
-    [request getNotificationsOfServer:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
+    [request getNotificationServer:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
         
         NSData *responseData = (NSData*) responseObject;
         
@@ -1400,17 +1408,16 @@
 
 #pragma mark - User Profile
 
-- (void) getUserProfileOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
+- (void) getUserProfileServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCComunication successRequest:(void(^)(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer)) successRequest failureRequest:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer)) failureRequest {
     
     serverPath = [serverPath stringByAppendingString:k_url_acces_remote_userprofile_api];
     serverPath = [serverPath stringByAppendingString:self.user];
-    //serverPath = [NSString stringWithFormat:@"%@ -H \"%@\"",serverPath, @"OCS-APIRequest: true"];
-    //serverPath = [serverPath encodeString:NSUTF8StringEncoding];
+    serverPath = [serverPath encodeString:NSUTF8StringEncoding];
 
     OCWebDAVClient *request = [OCWebDAVClient new];
     request = [self getRequestWithCredentials:request];
     
-    [request getUserProfileOfServer:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
+    [request getUserProfileServer:serverPath onCommunication:sharedOCComunication success:^(NSHTTPURLResponse *response, id responseObject) {
     
         NSData *responseData = (NSData*) responseObject;
         
@@ -1419,12 +1426,53 @@
         NSDictionary *jsongParsed = [NSJSONSerialization JSONObjectWithData:responseData options:NSJSONReadingMutableContainers error:&error];
         NSLog(@"[LOG] User Profile : %@",jsongParsed);
         
-        OCUserProfile *userProfile;
+        OCUserProfile *userProfile = [OCUserProfile new];
         
         if (jsongParsed.allKeys > 0) {
 
+            NSDictionary *ocs = [jsongParsed valueForKey:@"ocs"];
+            NSDictionary *meta = [ocs valueForKey:@"meta"];
+            NSDictionary *datas = [ocs valueForKey:@"data"];
+            
+            NSInteger statusCode = [[meta valueForKey:@"statuscode"] integerValue];
+            
+            if (statusCode == kOCUserProfileAPISuccessful) {
+                
+                userProfile.address = [datas valueForKey:@"address"];
+                userProfile.displayName = [datas valueForKey:@"displayname"];
+                userProfile.email = [datas valueForKey:@"email"];
+                userProfile.enabled = [[datas valueForKey:@"enabled"] boolValue];
+                userProfile.id = [datas valueForKey:@"id"];
+                userProfile.phone = [datas valueForKey:@"phone"];
+                userProfile.twitter = [datas valueForKey:@"twitter"];
+                userProfile.webpage = [datas valueForKey:@"webpage"];
+
+                /* QUOTA */
+                    
+                NSDictionary *quotaDic = [datas valueForKey:@"quota"];
+                
+                userProfile.quotaFree = [[quotaDic valueForKey:@"free"] doubleValue];
+                userProfile.quota = [[quotaDic valueForKey:@"quota"] doubleValue];
+                userProfile.quotaRelative = [[quotaDic valueForKey:@"relative"] doubleValue];
+                userProfile.quotaTotal = [[quotaDic valueForKey:@"total"] doubleValue];
+                userProfile.quotaUsed = [[quotaDic valueForKey:@"used"] doubleValue];
+                
+            } else {
+                
+                NSString *message = (NSString*)[meta objectForKey:@"message"];
+                
+                if ([message isKindOfClass:[NSNull class]]) {
+                    message = @"";
+                }
+                
+                NSError *error = [UtilsFramework getErrorWithCode:statusCode andCustomMessageFromTheServer:message];
+                failureRequest(response, error, request.redirectedServer);
+            }
         }
         
+        //Return success
+        successRequest(response, userProfile, request.redirectedServer);
+        
     } failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) {
     
         failureRequest(response, error, request.redirectedServer);

+ 2 - 0
Libraries external/OCCommunicationLib/OCCommunicationLib/OCErrorMsg.h

@@ -40,6 +40,8 @@
 #define kOCNotificationAPINoContent  204
 #define kOCNotificationAPISuccessful 200
 
+#define kOCUserProfileAPISuccessful 100
+
 typedef enum {
     OCServerErrorForbiddenCharacters = 101,
 } OCServerErrorEnum;

+ 16 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCNotifications.h

@@ -3,7 +3,22 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 23/01/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #import <Foundation/Foundation.h>

+ 17 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCNotifications.m

@@ -3,8 +3,24 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 23/01/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
 //
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
 
 #import "OCNotifications.h"
 

+ 16 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCNotificationsAction.h

@@ -3,7 +3,22 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 23/01/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #import <Foundation/Foundation.h>

+ 16 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCNotificationsAction.m

@@ -3,7 +3,22 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 23/01/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #import "OCNotificationsAction.h"

+ 28 - 9
Libraries external/OCCommunicationLib/OCCommunicationLib/OCUserProfile.h

@@ -3,23 +3,42 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 16/02/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #import <Foundation/Foundation.h>
 
 @interface OCUserProfile : NSObject
 
-@property double quotaFree;
-@property double quotaUsed;
-@property double quotaTotal;
-@property double quotaRelative;
-@property double quota;
-@property (nonatomic, strong) NSString *email;
+@property (nonatomic, strong) NSString *id;
+@property BOOL enabled;
+
+@property (nonatomic, strong) NSString *address;
 @property (nonatomic, strong) NSString *displayName;
+@property (nonatomic, strong) NSString *email;
 @property (nonatomic, strong) NSString *phone;
-@property (nonatomic, strong) NSString *address;
-@property (nonatomic, strong) NSString *webpage;
 @property (nonatomic, strong) NSString *twitter;
+@property (nonatomic, strong) NSString *webpage;
+
+@property double quota;
+@property double quotaFree;
+@property double quotaRelative;
+@property double quotaTotal;
+@property double quotaUsed;
 
 @end

+ 16 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCUserProfile.m

@@ -3,7 +3,22 @@
 //  ownCloud iOS library
 //
 //  Created by Marino Faggiana on 16/02/17.
-//  Copyright © 2017 ownCloud. All rights reserved.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
 #import "OCUserProfile.h"

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

@@ -24,6 +24,12 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 //
+//
+//  Add : getNotificationServer & setNotificationServer
+//  Add : getUserProfileServer
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
 
 
 #import "AFHTTPSessionManager.h"
@@ -482,7 +488,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;
+- (void) getNotificationServer:(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 set server Notification
@@ -513,6 +519,6 @@ extern NSString * _Nullable OCWebDAVModificationDateKey;
  *
  */
 
-- (void) getUserProfileOfServer:(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;
+- (void) getUserProfileServer:(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;
 
 @end

+ 8 - 2
Libraries external/OCCommunicationLib/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -24,6 +24,12 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 //
+//
+//  Add : getNotificationServer & setNotificationServer
+//  Add : getUserProfileServer
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
 
 
 #import "OCWebDAVClient.h"
@@ -625,7 +631,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 
 #pragma mark - Get Notification
 
-- (void) getNotificationsOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
+- (void) getNotificationServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
                           failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
     
     _requestMethod = @"GET";
@@ -655,7 +661,7 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 
 #pragma mark - Get User Profile
 
-- (void) getUserProfileOfServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
+- (void) getUserProfileServer:(NSString*)serverPath onCommunication:(OCCommunication *)sharedOCCommunication success:(void(^)(NSHTTPURLResponse *operation, id response))success
                           failure:(void(^)(NSHTTPURLResponse *operation, id  _Nullable responseObject, NSError *error))failure{
     
     _requestMethod = @"GET";

+ 1 - 1
iOSClient/CCGlobal.h

@@ -206,7 +206,7 @@ extern NSString *const BKPasscodeKeychainServiceName;
 #define actionGetFeaturesSuppServer                     @"getFeaturesSupportedByServer"
 #define actionGetUserAndGroup                           @"getUserAndGroup"
 #define actionGetUserProfile                            @"getUserProfile"
-#define actionGetNotificationsOfServer                  @"getNotificationsOfServer"
+#define actionGetNotificationServer                     @"getNotificationServer"
 #define actionSetNotificationServer                     @"setNotificationServer"
 #define actionMoveFileOrFolder                          @"moveFileOrFolder"
 #define actionReadFile                                  @"readFile"

+ 3 - 3
iOSClient/Main/CCMain.m

@@ -1059,7 +1059,7 @@
 #pragma mark ==== Notification  ====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)getNotificationsOfServerSuccess:(NSArray *)listOfNotifications
+- (void)getNotificationServerSuccess:(NSArray *)listOfNotifications
 {
     AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     NSString *old = @"", *new = @"";
@@ -1092,7 +1092,7 @@
         [self setUINavigationBarDefault];
 }
 
-- (void)getNotificationsOfServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
+- (void)getNotificationServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {    
     // Update NavigationBar
     if (!_isSelectedMode)
@@ -1156,7 +1156,7 @@
     metadataNet.action = actionGetCapabilities;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
-    metadataNet.action = actionGetNotificationsOfServer;
+    metadataNet.action = actionGetNotificationServer;
     [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 
     metadataNet.action = actionGetUserProfile;

+ 2 - 2
iOSClient/Networking/OCNetworking.h

@@ -93,8 +93,8 @@
 - (void)getInfoServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 
 // Notification
-- (void)getNotificationsOfServerSuccess:(NSArray *)listOfNotifications;
-- (void)getNotificationsOfServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
+- (void)getNotificationServerSuccess:(NSArray *)listOfNotifications;
+- (void)getNotificationServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;
 
 - (void)setNotificationServerSuccess:(CCMetadataNet *)metadataNet;
 - (void)setNotificationServerFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode;

+ 7 - 7
iOSClient/Networking/OCNetworking.m

@@ -964,17 +964,17 @@
 #pragma mark =====  Notification =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)getNotificationsOfServer
+- (void)getNotificationServer
 {
     OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
     
     [communication setCredentialsWithUser:_activeUser andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    [communication getNotificationsOfServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer) {
+    [communication getNotificationServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSArray *listOfNotifications, NSString *redirectedServer) {
         
-        if ([self.delegate respondsToSelector:@selector(getNotificationsOfServerSuccess:)])
-            [self.delegate getNotificationsOfServerSuccess:listOfNotifications];
+        if ([self.delegate respondsToSelector:@selector(getNotificationServerSuccess:)])
+            [self.delegate getNotificationServerSuccess:listOfNotifications];
         
         [self complete];
         
@@ -984,8 +984,8 @@
         if (errorCode == 0)
             errorCode = error.code;
         
-        if([self.delegate respondsToSelector:@selector(getNotificationsOfServerFailure:message:errorCode:)])
-            [self.delegate getNotificationsOfServerFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
+        if([self.delegate respondsToSelector:@selector(getNotificationServerFailure:message:errorCode:)])
+            [self.delegate getNotificationServerFailure:_metadataNet message:[error.userInfo valueForKey:@"NSLocalizedDescription"] errorCode:errorCode];
         
         // Request trusted certificated
         if ([error code] == NSURLErrorServerCertificateUntrusted)
@@ -1039,7 +1039,7 @@
     [communication setCredentialsWithUser:_activeUser andPassword:_activePassword];
     [communication setUserAgent:[CCUtility getUserAgent]];
     
-    [communication getUserProfileOfServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer) {
+    [communication getUserProfileServer:[_activeUrl stringByAppendingString:@"/"] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, OCUserProfile *userProfile, NSString *redirectedServer) {
         
         if ([self.delegate respondsToSelector:@selector(getUserProfileSuccess:userProfile:)])
             [self.delegate getUserProfileSuccess:_metadataNet userProfile:userProfile];