Skip to content

Commit

Permalink
Merge pull request #1071 from meganz/release/v3.3.8
Browse files Browse the repository at this point in the history
Release/v3.3.8
  • Loading branch information
sergiohs84 authored May 31, 2018
2 parents 0ea392a + 0cdef20 commit 37a231c
Show file tree
Hide file tree
Showing 33 changed files with 916 additions and 195 deletions.
4 changes: 2 additions & 2 deletions bindings/ios/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ typedef NS_ENUM(NSUInteger, Retry) {
* @param longitude Longitude in signed decimal degrees notation.
* @param delegate Delegate to track this request.
*/
- (void)setNodeCoordinates:(MEGANode *)node latitude:(NSNumber *)latitude longitude:(NSNumber *)longitude delegate:(id<MEGARequestDelegate>)delegate;
- (void)setNodeCoordinates:(MEGANode *)node latitude:(double)latitude longitude:(double)longitude delegate:(id<MEGARequestDelegate>)delegate;

/**
* @brief Set the GPS coordinates of image files as a node attribute.
Expand All @@ -2124,7 +2124,7 @@ typedef NS_ENUM(NSUInteger, Retry) {
* @param latitude Latitude in signed decimal degrees notation.
* @param longitude Longitude in signed decimal degrees notation.
*/
- (void)setNodeCoordinates:(MEGANode *)node latitude:(NSNumber *)latitude longitude:(NSNumber *)longitude;
- (void)setNodeCoordinates:(MEGANode *)node latitude:(double)latitude longitude:(double)longitude;

/**
* @brief Generate a public link of a file/folder in MEGA.
Expand Down
12 changes: 4 additions & 8 deletions bindings/ios/MEGASdk.mm
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,12 @@ - (void)publicNodeForMegaFileLink:(NSString *)megaFileLink {
self.megaApi->getPublicNode((megaFileLink != nil) ? [megaFileLink UTF8String] : NULL);
}

- (void)setNodeCoordinates:(MEGANode *)node latitude:(NSNumber *)latitude longitude:(NSNumber *)longitude delegate:(id<MEGARequestDelegate>)delegate {
double lat = latitude != nil ? latitude.doubleValue : MegaNode::INVALID_COORDINATE;
double lon = longitude != nil ? longitude.doubleValue : MegaNode::INVALID_COORDINATE;
self.megaApi->setNodeCoordinates((node != nil) ? [node getCPtr] : NULL, lat, lon, [self createDelegateMEGARequestListener:delegate singleListener:YES]);
- (void)setNodeCoordinates:(MEGANode *)node latitude:(double)latitude longitude:(double)longitude delegate:(id<MEGARequestDelegate>)delegate {
self.megaApi->setNodeCoordinates(node ? [node getCPtr] : NULL, (latitude ? latitude : MegaNode::INVALID_COORDINATE), (longitude ? longitude : MegaNode::INVALID_COORDINATE), [self createDelegateMEGARequestListener:delegate singleListener:YES]);
}

- (void)setNodeCoordinates:(MEGANode *)node latitude:(NSNumber *)latitude longitude:(NSNumber *)longitude {
double lat = latitude != nil ? latitude.doubleValue : MegaNode::INVALID_COORDINATE;
double lon = longitude != nil ? longitude.doubleValue : MegaNode::INVALID_COORDINATE;
self.megaApi->setNodeCoordinates((node != nil) ? [node getCPtr] : NULL, lat, lon);
- (void)setNodeCoordinates:(MEGANode *)node latitude:(double)latitude longitude:(double)longitude {
self.megaApi->setNodeCoordinates(node ? [node getCPtr] : NULL, (latitude ? latitude : MegaNode::INVALID_COORDINATE), (longitude ? longitude : MegaNode::INVALID_COORDINATE));
}

- (void)exportNode:(MEGANode *)node delegate:(id<MEGARequestDelegate>)delegate {
Expand Down
160 changes: 159 additions & 1 deletion bindings/java/nz/mega/sdk/MegaApiJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,18 @@ public String getMyEmail() {
public String getMyUserHandle() {
return megaApi.getMyUserHandle();
}

/**
* Returns the user handle of the currently open account
*
* If the MegaApi object isn't logged in,
* this function returns INVALID_HANDLE
*
* @return User handle of the account
*/
public long getMyUserHandleBinary(){
return megaApi.getMyUserHandleBinary();
}

/**
* Get the MegaUser of the currently open account
Expand All @@ -1457,7 +1469,6 @@ public String getMyUserHandle() {
* @note The visibility of your own user is unhdefined and shouldn't be used.
* @return MegaUser of the currently open account, otherwise NULL
*/

public MegaUser getMyUser(){
return megaApi.getMyUser();
}
Expand Down Expand Up @@ -3395,6 +3406,153 @@ public void shouldShowPasswordReminderDialog(boolean atLogout, MegaRequestListen
megaApi.shouldShowPasswordReminderDialog(atLogout, createDelegateRequestListener(listener));
}

/**
* Enable or disable the generation of rich previews
*
* The associated request type with this request is MegaRequest::TYPE_SET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
*
* @param enable True to enable the generation of rich previews
* @param listener MegaRequestListener to track this request
*/
public void enableRichPreviews(boolean enable, MegaRequestListenerInterface listener){
megaApi.enableRichPreviews(enable, createDelegateRequestListener(listener));
}

/**
* Enable or disable the generation of rich previews
*
* The associated request type with this request is MegaRequest::TYPE_SET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
*
* @param enable True to enable the generation of rich previews
*/
public void enableRichPreviews(boolean enable){
megaApi.enableRichPreviews(enable);
}

/**
* Check if rich previews are automatically generated
*
* The associated request type with this request is MegaRequest::TYPE_GET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
* - MegaRequest::getNumDetails - Returns zero
*
* Valid data in the MegaRequest object received in onRequestFinish when the error code
* is MegaError::API_OK:
* - MegaRequest::getFlag - Returns true if generation of rich previews is enabled
* - MegaRequest::getMegaStringMap - Returns the raw content of the atribute: [<key><value>]*
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MegaError::API_ENOENT, but the value of MegaRequest::getFlag will still be valid (false).
*
* @param listener MegaRequestListener to track this request
*/
public void isRichPreviewsEnabled(MegaRequestListenerInterface listener){
megaApi.isRichPreviewsEnabled(createDelegateRequestListener(listener));
}

/**
* Check if rich previews are automatically generated
*
* The associated request type with this request is MegaRequest::TYPE_GET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
* - MegaRequest::getNumDetails - Returns zero
*
* Valid data in the MegaRequest object received in onRequestFinish when the error code
* is MegaError::API_OK:
* - MegaRequest::getFlag - Returns true if generation of rich previews is enabled
* - MegaRequest::getMegaStringMap - Returns the raw content of the atribute: [<key><value>]*
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MegaError::API_ENOENT, but the value of MegaRequest::getFlag will still be valid (false).
*
*/
public void isRichPreviewsEnabled(){
megaApi.isRichPreviewsEnabled();
}

/**
* Check if the app should show the rich link warning dialog to the user
*
* The associated request type with this request is MegaRequest::TYPE_GET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
* - MegaRequest::getNumDetails - Returns one
*
* Valid data in the MegaRequest object received in onRequestFinish when the error code
* is MegaError::API_OK:
* - MegaRequest::getFlag - Returns true if it is necessary to show the rich link warning
* - MegaRequest::getNumber - 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.
* - MegaRequest::getMegaStringMap - Returns the raw content of the atribute: [<key><value>]*
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MegaError::API_ENOENT, but the value of MegaRequest::getFlag will still be valid (true).
*
* @param listener MegaRequestListener to track this request
*/
public void shouldShowRichLinkWarning(MegaRequestListenerInterface listener){
megaApi.shouldShowRichLinkWarning(createDelegateRequestListener(listener));
}

/**
* Check if the app should show the rich link warning dialog to the user
*
* The associated request type with this request is MegaRequest::TYPE_GET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
* - MegaRequest::getNumDetails - Returns one
*
* Valid data in the MegaRequest object received in onRequestFinish when the error code
* is MegaError::API_OK:
* - MegaRequest::getFlag - Returns true if it is necessary to show the rich link warning
* - MegaRequest::getNumber - 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.
* - MegaRequest::getMegaStringMap - Returns the raw content of the atribute: [<key><value>]*
*
* If the corresponding user attribute is not set yet, the request will fail with the
* error code MegaError::API_ENOENT, but the value of MegaRequest::getFlag will still be valid (true).
*
*/
public void shouldShowRichLinkWarning(){

megaApi.shouldShowRichLinkWarning();
}

/**
* 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 MegaRequest::TYPE_SET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
*
* @param value Number of times "Not now" option has been selected
* @param listener MegaRequestListener to track this request
*/
public void setRichLinkWarningCounterValue(int value, MegaRequestListenerInterface listener){
megaApi.setRichLinkWarningCounterValue(value, createDelegateRequestListener(listener));
}

/**
* 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 MegaRequest::TYPE_SET_ATTR_USER
* Valid data in the MegaRequest object received on callbacks:
* - MegaRequest::getParamType - Returns the attribute type MegaApi::USER_ATTR_RICH_PREVIEWS
*
* @param value Number of times "Not now" option has been selected
*/
public void setRichLinkWarningCounterValue(int value){
megaApi.setRichLinkWarningCounterValue(value);
}

/**
* Change the password of the MEGA account
*
Expand Down
5 changes: 5 additions & 0 deletions bindings/wp8/MTransfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ bool MTransfer::isStreamingTransfer()
return megaTransfer ? megaTransfer->isStreamingTransfer() : false;
}

bool MTransfer::isFinished()
{
return megaTransfer ? megaTransfer->isFinished() : false;
}

bool MTransfer::isFolderTransfer()
{
return megaTransfer ? megaTransfer->isFolderTransfer() : false;
Expand Down
7 changes: 7 additions & 0 deletions bindings/wp8/MTransfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ namespace mega
MNode^ getPublicMegaNode();
bool isSyncTransfer();
bool isStreamingTransfer();

/**
* @brief Returns true is the transfer is at finished state (COMPLETED, CANCELLED OR FAILED)
* @return true if this transfer is finished, false otherwise
*/
bool isFinished();

bool isFolderTransfer();
int getFolderTransferTag();
String^ getAppData();
Expand Down
10 changes: 10 additions & 0 deletions bindings/wp8/MegaSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3636,6 +3636,16 @@ void MegaSDK::getContactLinksOption()
megaApi->getContactLinksOption();
}

void MegaSDK::retrySSLerrors(bool enable)
{
megaApi->retrySSLerrors(enable);
}

void MegaSDK::setPublicKeyPinning(bool enable)
{
megaApi->setPublicKeyPinning(enable);
}

bool MegaSDK::createThumbnail(String^ imagePath, String^ dstPath)
{
std::string utf8imagePath;
Expand Down
70 changes: 68 additions & 2 deletions bindings/wp8/MegaSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,49 @@ namespace mega

void removeContact(MUser^ user, MRequestListenerInterface^ listener);
void removeContact(MUser^ user);
void logout(MRequestListenerInterface^ listener);

/**
* @brief Logout of the MEGA account invalidating the session
*
* The associated request type with this request is MRequestType::TYPE_LOGOUT
*
* Under certain circumstances, this request might return the error code
* MError::API_ESID. It should not be taken as an error, since the reason
* is that the logout action has been notified before the reception of the
* logout response itself.
*
* @param listener MRequestListener to track this request
*/
void logout(MRequestListenerInterface^ listener);

/**
* @brief Logout of the MEGA account invalidating the session
*
* The associated request type with this request is MRequestType::TYPE_LOGOUT
*
* Under certain circumstances, this request might return the error code
* MError::API_ESID. It should not be taken as an error, since the reason
* is that the logout action has been notified before the reception of the
* logout response itself.
*/
void logout();

/**
* @brief Logout of the MEGA account without invalidating the session
*
* The associated request type with this request is MRequestType::TYPE_LOGOUT
*
* @param listener MRequestListener to track this request
*/
void localLogout(MRequestListenerInterface^ listener);
void localLogout();

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

int getPasswordStrength(String^ password);
void submitFeedback(int rating, String^ comment, MRequestListenerInterface^ listener);
void submitFeedback(int rating, String^ comment);
Expand Down Expand Up @@ -1032,6 +1071,33 @@ namespace mega
*/
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 false 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 MegaRequestType::TYPE_LOGOUT
* 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 MError::API_EINCOMPLETE
*
* @param enable true to keep retrying failed requests due to a fail checking the MEGA public key
* or false 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 true to keep public key pinning enabled, false to disable it
*/
void setPublicKeyPinning(bool enable);

bool createThumbnail(String^ imagePath, String^ dstPath);
bool createPreview(String^ imagePath, String^ dstPath);

Expand Down
17 changes: 17 additions & 0 deletions contrib/build_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,23 @@ freeimage_pkg() {
export FREEIMAGE_LIBRARY_TYPE=STATIC
fi

cat << EOF > $build_dir/freeimage_neon_arm64_patch
138c138
< # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
---
> //# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
1931,1932c1931,1932
< PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
< (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
---
> //PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
> // (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
EOF
# freeimage's LibPNG has a problem with deciding to use neon on 64 bit arm, resulting in a missing symbol
if [ "$ARCH" == "aarch64" ]; then
(patch `find . -name pngpriv.h` < $build_dir/freeimage_neon_arm64_patch)
fi

if [ "$(expr substr $(uname -s) 1 10)" != "MINGW32_NT" ]; then
package_build $name $freeimage_dir
# manually copy header and library
Expand Down
Loading

0 comments on commit 37a231c

Please sign in to comment.