diff --git a/.travis.yml b/.travis.yml index 220f9327..9c9b30fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode8.2 +osx_image: xcode8.3 #xcode_project: OCCommunicationLib/ownCloud iOS library.xcodeproj #xcode_scheme: ownCloud iOS library #xcode_sdk: iphonesimulator diff --git a/OCCommunicationLib/OCCommunicationLib/OCCommunication.h b/OCCommunicationLib/OCCommunicationLib/OCCommunication.h index 2c9756bb..af15c95e 100644 --- a/OCCommunicationLib/OCCommunicationLib/OCCommunication.h +++ b/OCCommunicationLib/OCCommunicationLib/OCCommunication.h @@ -511,8 +511,8 @@ typedef enum { * @param sharedOCCommunication -> OCCommunication Singleton of communication to add the operation on the queue. */ - (void) getUserDisplayNameOfServer:(NSString *)path onCommunication:(OCCommunication *)sharedOCCommunication - success:(void(^)(NSHTTPURLResponse *response, NSString *displayName, NSString *redirectedServer))success - failure:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer))failureRequest; + success:(void(^)(NSHTTPURLResponse *response, NSString *serverUserId, NSString *displayName, NSString *redirectedServer))success + failure:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer))failureRequest ; ///----------------------------------- diff --git a/OCCommunicationLib/OCCommunicationLib/OCCommunication.m b/OCCommunicationLib/OCCommunicationLib/OCCommunication.m index 184c770a..77ebf0a8 100644 --- a/OCCommunicationLib/OCCommunicationLib/OCCommunication.m +++ b/OCCommunicationLib/OCCommunicationLib/OCCommunication.m @@ -653,7 +653,7 @@ - (void) getUserDataOfServer:(NSString *)path onCommunication:(OCCommunication * ///----------------------------------- - (void) getUserDisplayNameOfServer:(NSString *)path onCommunication:(OCCommunication *)sharedOCCommunication - success:(void(^)(NSHTTPURLResponse *response, NSString *displayName, NSString *redirectedServer))success + success:(void(^)(NSHTTPURLResponse *response, NSString *serverUserId, NSString *displayName, NSString *redirectedServer))success failure:(void(^)(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer))failureRequest { OCWebDAVClient *request = [OCWebDAVClient new]; @@ -664,6 +664,7 @@ - (void) getUserDisplayNameOfServer:(NSString *)path onCommunication:(OCCommunic NSError *jsonError = nil; NSString *displayName = @""; + NSString *serverUserId = @""; NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:responseObject options:kNilOptions error:&jsonError]; @@ -677,13 +678,15 @@ - (void) getUserDisplayNameOfServer:(NSString *)path onCommunication:(OCCommunic NSDictionary *userDataDict = [ocsDict objectForKey:k_json_ocs_data]; displayName = [userDataDict objectForKey:k_json_ocs_data_display_name]; + + serverUserId = [userDataDict objectForKey:k_json_ocs_data_user_id]; } for(NSString *key in [jsonDict allKeys]) { NSLog(@"%@",[jsonDict objectForKey:key]); } - success(response, displayName, request.redirectedServer); + success(response, serverUserId, displayName, request.redirectedServer); } failure:^(NSHTTPURLResponse *response, NSData *responseData, NSError *error) { failureRequest(response,error, request.redirectedServer); diff --git a/OCCommunicationLib/OCCommunicationLib/OCFrameworkConstants.h b/OCCommunicationLib/OCCommunicationLib/OCFrameworkConstants.h index c640d781..a6d4dd5d 100644 --- a/OCCommunicationLib/OCCommunicationLib/OCFrameworkConstants.h +++ b/OCCommunicationLib/OCCommunicationLib/OCFrameworkConstants.h @@ -50,6 +50,7 @@ #define k_json_ocs @"ocs" #define k_json_ocs_data @"data" #define k_json_ocs_data_display_name @"display-name" +#define k_json_ocs_data_user_id @"id" //Url to access to Shared API to create #define k_url_acces_shared_api @"ocs/v1.php/apps/files_sharing/api/v1/shares"