Skip to content

Commit

Permalink
Merge pull request #677 from meganz/release/v3.1.2
Browse files Browse the repository at this point in the history
Release/v3.1.2
  • Loading branch information
sergiohs84 authored Jun 6, 2017
2 parents 2a31faa + bdfd535 commit 1c92bfc
Show file tree
Hide file tree
Showing 30 changed files with 879 additions and 167 deletions.
6 changes: 3 additions & 3 deletions bindings/ios/MEGADelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
* @brief This function is called when there are new or updated contacts in the account.
*
* @param api MEGASdk object connected to the account.
* @param users List that contains the new or updated contacts.
* @param userList List that contains the new or updated contacts.
*/
- (void)onUsersUpdate:(MEGASdk *)api userList:(MEGAUserList *)userList;

Expand All @@ -142,12 +142,12 @@
* second parameter will be nil.
*
* @param api MEGASdk object connected to the account.
* @param nodes List that contains the new or updated nodes.
* @param nodeList List that contains the new or updated nodes.
*/
- (void)onNodesUpdate:(MEGASdk *)api nodeList:(MEGANodeList *)nodeList;

/**
* @brief This function is called when the account has been updated (upgraded/downgraded)
* @brief This function is called when the account has been updated (confirmed/upgraded/downgraded)
* @param api MEGASdk object connected to the account
*/
- (void)onAccountUpdate:(MEGASdk *)api;
Expand Down
6 changes: 3 additions & 3 deletions bindings/ios/MEGAGlobalDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @brief This function is called when there are new or updated contacts in the account.
*
* @param api MEGASdk object connected to the account.
* @param users List that contains the new or updated contacts.
* @param userList List that contains the new or updated contacts.
*/
- (void)onUsersUpdate:(MEGASdk *)api userList:(MEGAUserList *)userList;

Expand All @@ -46,12 +46,12 @@
* second parameter will be nil.
*
* @param api MEGASdk object connected to the account.
* @param nodes List that contains the new or updated nodes.
* @param nodeList List that contains the new or updated nodes.
*/
- (void)onNodesUpdate:(MEGASdk *)api nodeList:(MEGANodeList *)nodeList;

/**
* @brief This function is called when the account has been updated (upgraded/downgraded)
* @brief This function is called when the account has been updated (confirmed/upgraded/downgraded)
* @param api MEGASdk object connected to the account
*/
- (void)onAccountUpdate:(MEGASdk *)api;
Expand Down
5 changes: 4 additions & 1 deletion bindings/ios/MEGARequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ typedef NS_ENUM (NSInteger, MEGARequestType) {
MEGARequestTypeMoveTransfer,
MEGARequestTypeChatPresenceUrl,
MEGARequestTypeRegisterPushNotification,
MEGARequestTypeGetUserEmail
MEGARequestTypeGetUserEmail,
MEGARequestTypeAppVersion,
MEGARequestTypeGetLocalSSLCertificate,
MEGARequestTypeSendSignupLink
};

typedef NS_ENUM (NSInteger, MEGANodeAccessLevel) {
Expand Down
1 change: 1 addition & 0 deletions bindings/ios/MEGASDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@
"$(inherited)",
"$(PROJECT_DIR)/3rdparty/lib",
);
OTHER_CFLAGS = "-DNDEBUG";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = MEGASDK;
SKIP_INSTALL = YES;
Expand Down
92 changes: 90 additions & 2 deletions bindings/ios/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,14 @@ typedef NS_ENUM(NSInteger, HTTPServer) {
* - [MEGARequest name] - Returns the firstname of the user
* - [MEGARequest text] - Returns the lastname of the user
*
* If this request succeed, a confirmation email will be sent to the users.
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest sessionKey] - Returns the session id to resume the process
*
* If this request succeed, a new ephemeral session will be created for the new user
* and a confirmation email will be sent to the specified email address. The app may
* resume the create-account process by using MegaApi::resumeCreateAccount.
*
* If an account with the same email already exists, you will get the error code
* MEGAErrorTypeApiEExist in onRequestFinish
*
Expand All @@ -681,7 +688,14 @@ typedef NS_ENUM(NSInteger, HTTPServer) {
* - [MEGARequest name] - Returns the firstname of the user
* - [MEGARequest text] - Returns the lastname of the user
*
* If this request succeed, a confirmation email will be sent to the users.
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest sessionKey] - Returns the session id to resume the process
*
* If this request succeed, a new ephemeral session will be created for the new user
* and a confirmation email will be sent to the specified email address. The app may
* resume the create-account process by using MegaApi::resumeCreateAccount.
*
* If an account with the same email already exists, you will get the error code
* MEGAErrorTypeApiEExist in onRequestFinish
*
Expand All @@ -692,6 +706,55 @@ typedef NS_ENUM(NSInteger, HTTPServer) {
*/
- (void)createAccountWithEmail:(NSString *)email password:(NSString *)password firstname:(NSString *)firstname lastname:(NSString *)lastname;

/**
* @brief Resume a registration process
*
* When a user begins the account registration process by calling [MEGASdk createAccountWithEmail:
* password:firstname:lastname:delegate:], an ephemeral account is created.
*
* Until the user successfully confirms the signup link sent to the provided email address,
* you can resume the ephemeral session in order to change the email address, resend the
* signup link (@see [MEGASdk sendSignupLinkWithEmail:name:password:delegate:) and also
* to receive notifications in case the user confirms the account using another client
* ([MEGAGlobalDelegate onAccountUpdate:] or [MEGADelegate onAccountUpdate:]).
*
* The associated request type with this request is MEGARequestTypeCreateAccount.
* Valid data in the MegaRequest object received on callbacks:
* - [MEGARequest sessionKey] - Returns the session id to resume the process
* - [MEGARequest paramType] - Returns the value 1
*
* In case the account is already confirmed, the associated request will fail with
* error MEGAErrorTypeApiEArgs.
*
* @param sid Session id valid for the ephemeral account (@see [MEGASdk createAccountWithEmail:password:firstname:lastname:])
* @param delegate MEGARequestDelegate to track this request
*/
- (void)resumeCreateAccountWithSessionId:(NSString *)sessionId delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Resume a registration process
*
* When a user begins the account registration process by calling [MEGASdk createAccountWithEmail:
* password:firstname:lastname:delegate:], an ephemeral account is created.
*
* Until the user successfully confirms the signup link sent to the provided email address,
* you can resume the ephemeral session in order to change the email address, resend the
* signup link (@see [MEGASdk sendSignupLinkWithEmail:name:password:delegate:) and also
* to receive notifications in case the user confirms the account using another client
* ([MEGAGlobalDelegate onAccountUpdate:] or [MEGADelegate onAccountUpdate:]).
*
* The associated request type with this request is MEGARequestTypeCreateAccount.
* Valid data in the MegaRequest object received on callbacks:
* - [MEGARequest sessionKey] - Returns the session id to resume the process
* - [MEGARequest paramType] - Returns the value 1
*
* In case the account is already confirmed, the associated request will fail with
* error MEGAErrorTypeApiEArgs.
*
* @param sid Session id valid for the ephemeral account (@see [MEGASdk createAccountWithEmail:password:firstname:lastname:])
*/
- (void)resumeCreateAccountWithSessionId:(NSString *)sessionId;

/**
* @brief Initialize the creation of a new MEGA account with precomputed keys
*
Expand Down Expand Up @@ -731,6 +794,31 @@ typedef NS_ENUM(NSInteger, HTTPServer) {
*/
- (void)fastCreateAccountWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name;

/**
* @brief Sends the confirmation email for a new account
*
* This function is useful to send the confirmation link again or to send it to a different
* email address, in case the user mistyped the email at the registration form.
*
* @param email Email for the account
* @param name Firstname of the user
* @param password Password for the account
* @param delegate MEGARequestDelegate to track this request
*/
- (void)sendSignupLinkWithEmail:(NSString *)email name:(NSString *)name password:(NSString *)password delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Sends the confirmation email for a new account
*
* This function is useful to send the confirmation link again or to send it to a different
* email address, in case the user mistyped the email at the registration form.
*
* @param email Email for the account
* @param name Firstname of the user
* @param password Password for the account
*/
- (void)sendSignupLinkWithEmail:(NSString *)email name:(NSString *)name password:(NSString *)password;

/**
* @brief Get information about a confirmation link.
*
Expand Down
16 changes: 16 additions & 0 deletions bindings/ios/MEGASdk.mm
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,14 @@ - (void)createAccountWithEmail:(NSString *)email password:(NSString *)password f
self.megaApi->createAccount((email != nil) ? [email UTF8String] : NULL, (password != nil) ? [password UTF8String] : NULL, (firstname != nil) ? [firstname UTF8String] : NULL, (lastname != nil) ? [lastname UTF8String] : NULL, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)resumeCreateAccountWithSessionId:(NSString *)sessionId delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->resumeCreateAccount((sessionId != nil) ? [sessionId UTF8String] : NULL, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)resumeCreateAccountWithSessionId:(NSString *)sessionId {
self.megaApi->resumeCreateAccount((sessionId != nil) ? [sessionId UTF8String] : NULL);
}

- (void)fastCreateAccountWithEmail:(NSString *)email base64pwkey:(NSString *)base64pwkey name:(NSString *)name {
self.megaApi->fastCreateAccount((email != nil) ? [email UTF8String] : NULL, (base64pwkey != nil) ? [base64pwkey UTF8String] : NULL, (name != nil) ? [name UTF8String] : NULL);
}
Expand All @@ -451,6 +459,14 @@ - (void)fastCreateAccountWithEmail:(NSString *)email base64pwkey:(NSString *)bas
self.megaApi->fastCreateAccount((email != nil) ? [email UTF8String] : NULL, (base64pwkey != nil) ? [base64pwkey UTF8String] : NULL, (name != nil) ? [name UTF8String] : NULL, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)sendSignupLinkWithEmail:(NSString *)email name:(NSString *)name password:(NSString *)password delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->sendSignupLink((email != nil) ? [email UTF8String] : NULL, (name != nil) ? [name UTF8String] : NULL, (password != nil) ? [password UTF8String] : NULL, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)sendSignupLinkWithEmail:(NSString *)email name:(NSString *)name password:(NSString *)password {
self.megaApi->sendSignupLink((email != nil) ? [email UTF8String] : NULL, (name != nil) ? [name UTF8String] : NULL, (password != nil) ? [password UTF8String] : NULL);
}

- (void)querySignupLink:(NSString *)link {
self.megaApi->querySignupLink((link != nil) ? [link UTF8String] : NULL);
}
Expand Down
110 changes: 105 additions & 5 deletions bindings/java/nz/mega/sdk/MegaApiJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ public String dumpXMPPSession() {
* Name of the user.
* @param listener
* MegaRequestListener to track this request.
*
* @deprecated This function is deprecated and will eventually be removed. Instead,
* use the new version with firstname and lastname.
*/
public void createAccount(String email, String password, String name, MegaRequestListenerInterface listener) {
megaApi.createAccount(email, password, name, createDelegateRequestListener(listener));
Expand All @@ -781,11 +784,14 @@ public void createAccount(String email, String password, String name, MegaReques
* Password for the account.
* @param name
* Name of the user.
*
* @deprecated This function is deprecated and will eventually be removed. Instead,
* use the new version with firstname and lastname.
*/
public void createAccount(String email, String password, String name) {
megaApi.createAccount(email, password, name);
}

/**
* Initialize the creation of a new MEGA account, with firstname and lastname
*
Expand All @@ -796,20 +802,79 @@ public void createAccount(String email, String password, String name) {
* - MegaRequest::getName - Returns the firstname of the user
* - MegaRequest::getText - Returns the lastname of the user
*
* If this request succeed, a confirmation email will be sent to the users.
* Valid data in the MegaRequest object received in onRequestFinish when the error code
* is MegaError::API_OK:
* - MegaRequest::getSessionKey - Returns the session id to resume the process
*
* If this request succeed, a new ephemeral session will be created for the new user
* and a confirmation email will be sent to the specified email address. The app may
* resume the create-account process by using MegaApi::resumeCreateAccount.
*
* If an account with the same email already exists, you will get the error code
* MegaError::API_EEXIST in onRequestFinish
*
* @param email Email for the account
* @param password Password for the account
* @param firstname Firstname of the user
* @param lastname Lastname of the user
* @param listener MegaRequestListenerInterface to track this request
* @param listener MegaRequestListener to track this request
*/
public void createAccount(String email, String password, String firstname, String lastname, MegaRequestListenerInterface listener){
megaApi.createAccount(email, password, firstname, lastname, createDelegateRequestListener(listener));
}


/**
* Resume a registration process
*
* When a user begins the account registration process by calling MegaApi::createAccount,
* an ephemeral account is created.
*
* Until the user successfully confirms the signup link sent to the provided email address,
* you can resume the ephemeral session in order to change the email address, resend the
* signup link (@see MegaApi::sendSignupLink) and also to receive notifications in case the
* user confirms the account using another client (MegaGlobalListener::onAccountUpdate or
* MegaListener::onAccountUpdate).
*
* The associated request type with this request is MegaRequest::TYPE_CREATE_ACCOUNT.
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getSessionKey - Returns the session id to resume the process
* - MegaRequest::getParamType - Returns the value 1
*
* In case the account is already confirmed, the associated request will fail with
* error MegaError::API_EARGS.
*
* @param sid Session id valid for the ephemeral account (@see MegaApi::createAccount)
* @param listener MegaRequestListener to track this request
*/
public void resumeCreateAccount(String sid, MegaRequestListenerInterface listener) {
megaApi.resumeCreateAccount(sid, createDelegateRequestListener(listener));
}

/**
* Resume a registration process
*
* When a user begins the account registration process by calling MegaApi::createAccount,
* an ephemeral account is created.
*
* Until the user successfully confirms the signup link sent to the provided email address,
* you can resume the ephemeral session in order to change the email address, resend the
* signup link (@see MegaApi::sendSignupLink) and also to receive notifications in case the
* user confirms the account using another client (MegaGlobalListener::onAccountUpdate or
* MegaListener::onAccountUpdate).
*
* The associated request type with this request is MegaRequest::TYPE_CREATE_ACCOUNT.
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getSessionKey - Returns the session id to resume the process
* - MegaRequest::getParamType - Returns the value 1
*
* In case the account is already confirmed, the associated request will fail with
* error MegaError::API_EARGS.
*
* @param sid Session id valid for the ephemeral account (@see MegaApi::createAccount)
*/
public void resumeCreateAccount(String sid) {
megaApi.resumeCreateAccount(sid);
}

/**
* Initialize the creation of a new MEGA account with precomputed keys.
Expand All @@ -832,6 +897,9 @@ public void createAccount(String email, String password, String firstname, Strin
* Name of the user.
* @param listener
* MegaRequestListener to track this request.
*
* @deprecated This function is deprecated and will eventually be removed. Instead,
* use the new version with firstname and lastname.
*/
public void fastCreateAccount(String email, String base64pwkey, String name, MegaRequestListenerInterface listener) {
megaApi.fastCreateAccount(email, base64pwkey, name, createDelegateRequestListener(listener));
Expand All @@ -846,11 +914,43 @@ public void fastCreateAccount(String email, String base64pwkey, String name, Meg
* Private key calculated with MegaApiJava.getBase64PwKey().
* @param name
* Name of the user.
*
* @deprecated This function is deprecated and will eventually be removed. Instead,
* use the new version with firstname and lastname.
*/
public void fastCreateAccount(String email, String base64pwkey, String name) {
megaApi.fastCreateAccount(email, base64pwkey, name);
}

/**
* Sends the confirmation email for a new account
*
* This function is useful to send the confirmation link again or to send it to a different
* email address, in case the user mistyped the email at the registration form.
*
* @param email Email for the account
* @param name Firstname of the user
* @param password Password for the account
* @param listener MegaRequestListener to track this request
*/
public void sendSignupLink(String email, String name, String password, MegaRequestListenerInterface listener) {
megaApi.sendSignupLink(email, name, password, createDelegateRequestListener(listener));
}

/**
* Sends the confirmation email for a new account
*
* This function is useful to send the confirmation link again or to send it to a different
* email address, in case the user mistyped the email at the registration form.
*
* @param email Email for the account
* @param name Firstname of the user
* @param password Password for the account
*/
public void sendSignupLink(String email, String name, String password) {
megaApi.sendSignupLink(email, name, password);
}

/**
* Get information about a confirmation link.
* <p>
Expand Down Expand Up @@ -5255,7 +5355,7 @@ void privateFreeTransferListener(DelegateMegaTransferListener listener) {
activeTransferListeners.remove(listener);
}

static ArrayList<MegaNode> nodeListToArray(MegaNodeList nodeList) {
static public ArrayList<MegaNode> nodeListToArray(MegaNodeList nodeList) {
if (nodeList == null) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/wp8/MRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace mega
TYPE_GET_CHANGE_EMAIL_LINK, TYPE_CONFIRM_CHANGE_EMAIL_LINK,
TYPE_CHAT_UPDATE_PERMISSIONS, TYPE_CHAT_TRUNCATE, TYPE_CHAT_SET_TITLE, TYPE_SET_MAX_CONNECTIONS,
TYPE_PAUSE_TRANSFER, TYPE_MOVE_TRANSFER, TYPE_CHAT_PRESENCE_URL, TYPE_REGISTER_PUSH_NOTIFICATION,
TYPE_GET_USER_EMAIL, TYPE_APP_VERSION
TYPE_GET_USER_EMAIL, TYPE_APP_VERSION, TYPE_GET_LOCAL_SSL_CERT, TYPE_SEND_SIGNUP_LINK
};

public ref class MRequest sealed
Expand Down
Loading

0 comments on commit 1c92bfc

Please sign in to comment.