Skip to content

Commit

Permalink
Merge pull request #1055 from meganz/release/v3.3.7
Browse files Browse the repository at this point in the history
Release/v3.3.7
  • Loading branch information
sergiohs84 authored May 18, 2018
2 parents 37ed798 + 0393276 commit 0ea392a
Show file tree
Hide file tree
Showing 12 changed files with 393 additions and 45 deletions.
1 change: 1 addition & 0 deletions bindings/ios/MEGARequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ typedef NS_ENUM (NSInteger, MEGARequestType) {
MEGARequestTypeContactLinkQuery,
MEGARequestTypeContactLinkDelete,
MEGARequestTypeFolderInfo,
MEGARequestTypeRichLink,
TotalOfRequestTypes
};

Expand Down
173 changes: 172 additions & 1 deletion bindings/ios/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ typedef NS_ENUM(NSInteger, MEGAUserAttribute) {
MEGAUserAttributeSigCU255PublicKey = 9, // public - byte array
MEGAUserAttributeLanguage = 14, // private - char array
MEGAUserAttributePwdReminder = 15, // private - char array
MEGAUserAttributeContactLinkVerification = 17 // private - byte array
MEGAUserAttributeContactLinkVerification = 17, // private - byte array
MEGAUserAttributeRichPreviews = 18 // private - byte array
};

typedef NS_ENUM(NSInteger, MEGANodeAttribute) {
Expand Down Expand Up @@ -710,6 +711,23 @@ typedef NS_ENUM(NSUInteger, Retry) {
*/
- (void)logout;

/**
* @brief Logout of the MEGA account without invalidating the session
*
* The associated request type with this request is MEGARequestTypeLogout
*
* @param delegate Delegate to track this request.
*/
- (void)localLogoutWithDelegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Logout of the MEGA account without invalidating the session
*
* The associated request type with this request is MEGARequestTypeLogout
*
*/
- (void)localLogout;

/**
* @brief Invalidate the existing cache and create a fresh one
*/
Expand Down Expand Up @@ -3038,6 +3056,132 @@ typedef NS_ENUM(NSUInteger, Retry) {
*/
- (void)shouldShowPasswordReminderDialogAtLogout:(BOOL)atLogout;

/**
* @brief Enable or disable the generation of rich previews
*
* The associated request type with this request is MEGARequestTypeSetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
*
* @param enable YES to enable the generation of rich previews
* @param delegate MEGARequestDelegate to track this request
*/
- (void)enableRichPreviews:(BOOL)enable delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Enable or disable the generation of rich previews
*
* The associated request type with this request is MEGARequestTypeSetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
*
* @param enable YES to enable the generation of rich previews
*/
- (void)enableRichPreviews:(BOOL)enable;

/**
* @brief Check if rich previews are automatically generated
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
* - [MEGARequest numDetails] - Returns zero
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest flag] - Returns YES if generation of rich previews is enabled
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent, but the value of [MEGARequest flag] will still be valid (NO).
*
* @param delegate MEGARequestDelegate to track this request
*/
- (void)isRichPreviewsEnabledWithDelegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Check if rich previews are automatically generated
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
* - [MEGARequest numDetails] - Returns zero
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest flag] - Returns YES if generation of rich previews is enabled
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent, but the value of [MEGARequest flag] will still be valid (NO).
*
*/
- (void)isRichPreviewsEnabled;

/**
* @brief Check if the app should show the rich link warning dialog to the user
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
* - [MEGARequest numDetails] - Returns one
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest flag] - Returns YES if it is necessary to show the rich link warning
* - [MEGARequest number] - Returns the number of times that user has indicated that doesn't want
* modify the message with a rich link. If number is bigger than three, the extra option "Never"
* must be added to the warning dialog.
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent, but the value of [MEGARequest flag] will still be valid (YES).
*
* @param delegate MEGARequestDelegate to track this request
*/
- (void)shouldShowRichLinkWarningWithDelegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Check if the app should show the rich link warning dialog to the user
*
* The associated request type with this request is MEGARequestTypeGetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
* - [MEGARequest numDetails] - Returns one
*
* Valid data in the MEGARequest object received in onRequestFinish when the error code
* is MEGAErrorTypeApiOk:
* - [MEGARequest flag] - Returns YES if it is necessary to show the rich link warning
* - [MEGARequest number] - Returns the number of times that user has indicated that doesn't want
* modify the message with a rich link. If number is bigger than three, the extra option "Never"
* must be added to the warning dialog.
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MEGAErrorTypeApiENoent, but the value of [MEGARequest flag] will still be valid (YES).
*
*/
- (void)shouldShowRichLinkWarning;

/**
* @brief Set the number of times "Not now" option has been selected in the rich link warning dialog
*
* The associated request type with this request is MEGARequestTypeSetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
*
* @param value Number of times "Not now" option has been selected
* @param delegate MEGARequestDelegate to track this request
*/
- (void)setRichLinkWarningCounterValue:(NSUInteger)value delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Set the number of times "Not now" option has been selected in the rich link warning dialog
*
* The associated request type with this request is MEGARequestTypeSetAttrUser
* Valid data in the MEGARequest object received on callbacks:
* - [MEGARequest paramType] - Returns the attribute type MEGAUserAttributeRichPreviews
*
* @param value Number of times "Not now" option has been selected
*/
- (void)setRichLinkWarningCounterValue:(NSUInteger)value;

/**
* @brief Use HTTPS communications only
*
Expand Down Expand Up @@ -4753,6 +4897,33 @@ typedef NS_ENUM(NSUInteger, Retry) {
*/
- (void)getContactLinksOption;

/**
* @brief Keep retrying when public key pinning fails
*
* By default, when the check of the MEGA public key fails, it causes an automatic
* logout. Pass NO to this function to disable that automatic logout and
* keep the SDK retrying the request.
*
* Even if the automatic logout is disabled, a request of the type MEGARequestTypeLogout
* will be automatically created and callbacks (onRequestStart, onRequestFinish) will
* be sent. However, logout won't be really executed and in onRequestFinish the error code
* for the request will be MEGAErrorTypeApiEIncomplete
*
* @param enable YES to keep retrying failed requests due to a fail checking the MEGA public key
* or NO to perform an automatic logout in that case
*/
- (void)retrySSLErrors:(BOOL)enable;

/**
* @brief Enable / disable the public key pinning
*
* Public key pinning is enabled by default for all sensible communications.
* It is strongly discouraged to disable this feature.
*
* @param enable YES to keep public key pinning enabled, NO to disable it
*/
- (void)setPublicKeyPinning:(BOOL)enable;

/**
* @brief Create a thumbnail for an image
* @param imagePath Image path
Expand Down
48 changes: 48 additions & 0 deletions bindings/ios/MEGASdk.mm
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ - (void)logout {
self.megaApi->logout();
}

- (void)localLogoutWithDelegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->localLogout([self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)localLogout {
self.megaApi->localLogout();
}

- (void)invalidateCache {
self.megaApi->invalidateCache();
}
Expand Down Expand Up @@ -1023,6 +1031,38 @@ - (void)shouldShowPasswordReminderDialogAtLogout:(BOOL)atLogout {
self.megaApi->shouldShowPasswordReminderDialog(atLogout);
}

- (void)enableRichPreviews:(BOOL)enable delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->enableRichPreviews(enable, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)enableRichPreviews:(BOOL)enable {
self.megaApi->enableRichPreviews(enable);
}

- (void)isRichPreviewsEnabledWithDelegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->isRichPreviewsEnabled([self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)isRichPreviewsEnabled {
self.megaApi->isRichPreviewsEnabled();
}

- (void)shouldShowRichLinkWarningWithDelegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->shouldShowRichLinkWarning([self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)shouldShowRichLinkWarning {
self.megaApi->shouldShowRichLinkWarning();
}

- (void)setRichLinkWarningCounterValue:(NSUInteger)value delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->setRichLinkWarningCounterValue((int)value, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)setRichLinkWarningCounterValue:(NSUInteger)value {
self.megaApi->setRichLinkWarningCounterValue((int)value);
}

- (void)useHttpsOnly:(BOOL)httpsOnly delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->useHttpsOnly(httpsOnly, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}
Expand Down Expand Up @@ -1630,6 +1670,14 @@ - (void)getContactLinksOption {
self.megaApi->getContactLinksOption();
}

- (void)retrySSLErrors:(BOOL)enable {
self.megaApi->retrySSLerrors(enable);
}

- (void)setPublicKeyPinning:(BOOL)enable {
self.megaApi->setPublicKeyPinning(enable);
}

- (BOOL)createThumbnail:(NSString *)imagePath destinatioPath:(NSString *)destinationPath {
if (imagePath == nil || destinationPath == nil) return NO;

Expand Down
41 changes: 24 additions & 17 deletions bindings/ios/MEGAUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ typedef NS_ENUM (NSInteger, MEGAUserVisibility) {
};

typedef NS_ENUM(NSInteger, MEGAUserChangeType) {
MEGAUserChangeTypeAuth = 0x01,
MEGAUserChangeTypeLstint = 0x02,
MEGAUserChangeTypeAvatar = 0x04,
MEGAUserChangeTypeFirstname = 0x08,
MEGAUserChangeTypeLastname = 0x10,
MEGAUserChangeTypeEmail = 0x20,
MEGAUserChangeTypeKeyring = 0x40,
MEGAUserChangeTypeCountry = 0x80,
MEGAUserChangeTypeBirthday = 0x100,
MEGAUserChangeTypePubKeyCu255 = 0x200,
MEGAUserChangeTypePubKeyEd255 = 0x400,
MEGAUserChangeTypeSigPubKeyRsa = 0x800,
MEGAUserChangeTypeSigPubKeyCu255 = 0x1000,
MEGAUserChangeTypeLanguage = 0x2000,
MEGAUserChangeTypePwdReminder = 0x4000,
MEGAUserChangeTypeDisableVersions = 0x8000,
MEGAUserChangeTypeContactLinkVerification = 0x10000
MEGAUserChangeTypeAuth = 0x01,
MEGAUserChangeTypeLstint = 0x02,
MEGAUserChangeTypeAvatar = 0x04,
MEGAUserChangeTypeFirstname = 0x08,
MEGAUserChangeTypeLastname = 0x10,
MEGAUserChangeTypeEmail = 0x20,
MEGAUserChangeTypeKeyring = 0x40,
MEGAUserChangeTypeCountry = 0x80,
MEGAUserChangeTypeBirthday = 0x100,
MEGAUserChangeTypePubKeyCu255 = 0x200,
MEGAUserChangeTypePubKeyEd255 = 0x400,
MEGAUserChangeTypeSigPubKeyRsa = 0x800,
MEGAUserChangeTypeSigPubKeyCu255 = 0x1000,
MEGAUserChangeTypeLanguage = 0x2000,
MEGAUserChangeTypePwdReminder = 0x4000,
MEGAUserChangeTypeDisableVersions = 0x8000,
MEGAUserChangeTypeContactLinkVerification = 0x10000,
MEGAUserChangeTypeRichPreviews = 0x20000
};

/**
Expand Down Expand Up @@ -161,6 +162,9 @@ typedef NS_ENUM(NSInteger, MEGAUserChangeType) {
* - MEGAUserChangeTypeContactLinkVerification = 0x10000
* Check if option for automatic contact-link verification has changed
*
* - MEGAUserChangeTypeRichPreviews = 0x20000
* Check if option for rich links has changed
*
*/
@property (readonly, nonatomic) MEGAUserChangeType changes;

Expand Down Expand Up @@ -242,6 +246,9 @@ typedef NS_ENUM(NSInteger, MEGAUserChangeType) {
* - MEGAUserChangeTypeContactLinkVerification = 0x10000
* Check if option for automatic contact-link verification has changed
*
* - MEGAUserChangeTypeRichPreviews = 0x20000
* Check if option for rich links has changed
*
* @return YES if this user has an specific change
*/
- (BOOL)hasChangedType:(MEGAUserChangeType)changeType;
Expand Down
2 changes: 1 addition & 1 deletion examples/android/ExampleApp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You have two options, using a prebuilt native library or building it by yourself
```
git clone --recursive https://github.com/meganz/sdk.git
```
* Download the prebuilt libraries (`libmega.so`) along with its corresponding Java classes from [here](https://mega.nz/#!AkMXUBiL!CXiHUPCo2EV6TllFr-k1fMHnZM5_VfgDAzTmoAoNRoo). Generated with commit: 84a546f81e04ca2845fbfceae5634ed57eeef957
* Download the prebuilt libraries (`libmega.so`) along with its corresponding Java classes from [here](https://mega.nz/#!F9MDiIYR!Udguz_byyIttpjaa2twcWZGqcqWCfalhGO-_jg7kNCo). Generated with commit: 08adf46ca80dd8aa9f54916b998c2efe1f7a444d
* Extract the content into `app/src/main`, keeping the folder structure.
* Open the project with Android Studio, let it build the project and hit _*Run*_

Expand Down
2 changes: 1 addition & 1 deletion include/mega/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#define MEGA_MINOR_VERSION 3
#endif
#ifndef MEGA_MICRO_VERSION
#define MEGA_MICRO_VERSION 6
#define MEGA_MICRO_VERSION 7
#endif
Loading

0 comments on commit 0ea392a

Please sign in to comment.