Skip to content

Commit

Permalink
Merge pull request #1427 from meganz/release/v3.5.1
Browse files Browse the repository at this point in the history
Release/v3.5.1
  • Loading branch information
sergiohs84 authored May 7, 2019
2 parents 71ae619 + eb55118 commit 54bf12c
Show file tree
Hide file tree
Showing 76 changed files with 6,534 additions and 743 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ doc/example/lsmega
*~
Debug
Release
/contrib/QtCreator/build-*
/contrib/QtCreator/MEGAcli/MEGAcli.pro.user
/contrib/QtCreator/MEGAtests/MEGAtests.pro.user
/contrib/QtCreator/MEGAsymplesync/MEGAsymplesync.pro.user
/contrib/QtCreator/megacli.creator.user
/contrib/cmake/cmake-build-*
/contrib/cmake/.idea
megaclient_statecache*

# Mega SDK runtime
*.db-journal

/third_party/Makefile

/contrib/QtCreator/build-*
/contrib/cmake/.idea
/contrib/cmake/cmake-build-*
2 changes: 2 additions & 0 deletions Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ COMMON_SRC=\
src/json.cpp \
src/node.cpp \
src/pubkeyaction.cpp \
src/raid.cpp \
src/request.cpp \
src/serialize64.cpp \
src/share.cpp \
src/sharenodekeys.cpp \
src/sync.cpp \
src/testhooks.cpp \
src/transfer.cpp \
src/transferslot.cpp \
src/treeproc.cpp \
Expand Down
93 changes: 93 additions & 0 deletions bindings/ios/MEGARecentActionBucket.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* @file MEGARecentActionBucket.h
* @brief Represents a set of files uploaded or updated in MEGA.
*
* (c) 2019 - Present by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth in the Terms of Service.
*
* The MEGA SDK 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.
*
* @copyright Simplified (2-clause) BSD License.
*
* You should have received a copy of the license along with this
* program.
*/

#import <Foundation/Foundation.h>

@class MEGANodeList;

/**
* @brief Represents a set of files uploaded or updated in MEGA.
* These are used to display the recent changes to an account.
*
* Objects of this class aren't live, they are snapshots of the state
* in MEGA when the object is created, they are immutable.
*
* MEGARecentActionBucket objects can be retrieved with -[MEGASdk recentActionsSinceDate:maxNodes:]
*
*/
@interface MEGARecentActionBucket : NSObject

/**
* @brief Creates a copy of this MEGARecentActionBucket object.
*
* The resulting object is fully independent of the source MEGARecentActionBucket,
* it contains a copy of all internal attributes, so it will be valid after
* the original object is deleted.
*
* You are the owner of the returned object
*
* @return Copy of the MEGARecentActionBucket object
*/
- (instancetype)clone;

/**
* @brief Returns a timestamp reflecting when these changes occurred
*
* @return Timestamp indicating when the changes occurred
*/
@property (readonly, nonatomic) NSDate *timestamp;

/**
* @brief Returns the email of the user who made the changes
*
* @return the associated user's email
*/
@property (readonly, nonatomic) NSString *userEmail;

/**
* @brief Returns the handle of the parent folder these changes occurred in
*
* @return the handle of the parent folder for these changes.
*/
@property (readonly, nonatomic) uint64_t parentHandle;

/**
* @brief Returns whether the changes are updated files, or new files
*
* @return YES if the changes are updates rather than newly uploaded files.
*/
@property (readonly, nonatomic, getter=isUpdate) BOOL update;

/**
* @brief Returns whether the files are photos or videos
*
* @return YES if the files in this change are media files.
*/
@property (readonly, nonatomic, getter=isMedia) BOOL media;

/**
* @brief Returns nodes representing the files changed in this bucket
*
* @return A list of the files in the bucket. The bucket retains ownership.
*/
@property (readonly, nonatomic) MEGANodeList *nodesList;

@end
93 changes: 93 additions & 0 deletions bindings/ios/MEGARecentActionBucket.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* @file MEGARecentActionBucket.mm
* @brief Represents a set of files uploaded or updated in MEGA.
*
* (c) 2019 - Present by Mega Limited, Auckland, New Zealand
*
* This file is part of the MEGA SDK - Client Access Engine.
*
* Applications using the MEGA API must present a valid application key
* and comply with the the rules set forth in the Terms of Service.
*
* The MEGA SDK 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.
*
* @copyright Simplified (2-clause) BSD License.
*
* You should have received a copy of the license along with this
* program.
*/

#import "MEGARecentActionBucket.h"

#import "megaapi.h"

#import "MEGARecentActionBucket+init.h"
#import "MEGANodeList+init.h"

using namespace mega;

@interface MEGARecentActionBucket ()

@property MegaRecentActionBucket *recentActionBucket;
@property BOOL cMemoryOwn;

@end

@implementation MEGARecentActionBucket

- (instancetype)initWithMegaRecentActionBucket:(MegaRecentActionBucket *)megaRecentActionBucket cMemoryOwn:(BOOL)cMemoryOwn {
self = [super init];
if (self) {
_recentActionBucket = megaRecentActionBucket;
_cMemoryOwn = cMemoryOwn;
}

return self;
}

- (instancetype)clone {
return self.recentActionBucket ? [MEGARecentActionBucket.alloc initWithMegaRecentActionBucket:self.recentActionBucket->copy() cMemoryOwn:YES] : nil;
}

- (MegaRecentActionBucket *)getCPtr {
return self.recentActionBucket;
}

- (void)dealloc {
if (self.cMemoryOwn) {
delete _recentActionBucket;
}
}

- (NSDate *)timestamp {
return self.recentActionBucket ? [NSDate.alloc initWithTimeIntervalSince1970:self.recentActionBucket->getTimestamp()] : nil;
}

- (NSString *)userEmail {
if (self.recentActionBucket) {
return self.recentActionBucket->getUserEmail() ? [NSString.alloc initWithUTF8String:self.recentActionBucket->getUserEmail()] : nil;
} else {
return nil;
}
}

- (uint64_t)parentHandle {
return self.recentActionBucket ? self.recentActionBucket->getParentHandle() : ::mega::INVALID_HANDLE;
}

- (BOOL)isUpdate {
return self.recentActionBucket->isUpdate();
}

- (BOOL)isMedia {
return self.recentActionBucket->isMedia();
}

- (MEGANodeList *)nodesList {
return self.recentActionBucket ? [MEGANodeList.alloc initWithNodeList:self.recentActionBucket->getNodes()->copy() cMemoryOwn:YES] : nil;
}

@end

14 changes: 14 additions & 0 deletions bindings/ios/MEGASDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
41D143DA1B5FC053000CA86F /* pendingcontactrequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41D143D91B5FC053000CA86F /* pendingcontactrequest.cpp */; };
41D98D011BD54B5200764370 /* MEGAContactRequest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41D98D001BD54B5200764370 /* MEGAContactRequest.mm */; };
41D98D071BD562AD00764370 /* MEGAContactRequestList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 41D98D061BD562AD00764370 /* MEGAContactRequestList.mm */; };
5B1D7CE221F1E07200B0215E /* MEGARecentActionBucket.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B1D7CE121F1E07200B0215E /* MEGARecentActionBucket.mm */; };
5B23B77C2164FC7C00600733 /* MEGAUserAlert.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B23B77A2164FC7C00600733 /* MEGAUserAlert.mm */; };
5B23B77D2164FC7C00600733 /* MEGAUserAlertList.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5B23B77B2164FC7C00600733 /* MEGAUserAlertList.mm */; };
5B72A14D20D3B3FB007FE4FD /* mega_ccronexpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5B72A14C20D3B3FB007FE4FD /* mega_ccronexpr.cpp */; };
Expand Down Expand Up @@ -89,6 +90,7 @@
A88722DC1FFE6A8B00E3F443 /* mediafileattribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A88722DB1FFE6A8A00E3F443 /* mediafileattribute.cpp */; };
A8A86BD51F559EDA00C214DA /* mega_zxcvbn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A86BD41F559EDA00C214DA /* mega_zxcvbn.cpp */; };
A8FD7B641E93B40E0031FC50 /* osxutils.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8FD7B631E93B40E0031FC50 /* osxutils.mm */; };
B6657E9C225C2B6200EF8D91 /* raid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6657E9B225C2B6200EF8D91 /* raid.cpp */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -135,6 +137,9 @@
41D98D061BD562AD00764370 /* MEGAContactRequestList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MEGAContactRequestList.mm; sourceTree = "<group>"; };
41D98D081BD5679C00764370 /* MEGAContactRequestList+init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MEGAContactRequestList+init.h"; sourceTree = "<group>"; };
41F01E301C087D4C001E18E6 /* GfxProcCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GfxProcCG.h; sourceTree = "<group>"; };
5B0670CD21F5BABD00AD9F99 /* MEGARecentActionBucket+init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MEGARecentActionBucket+init.h"; sourceTree = "<group>"; };
5B1D7CDD21F1E01E00B0215E /* MEGARecentActionBucket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MEGARecentActionBucket.h; sourceTree = "<group>"; };
5B1D7CE121F1E07200B0215E /* MEGARecentActionBucket.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MEGARecentActionBucket.mm; sourceTree = "<group>"; };
5B23B7782164FC7C00600733 /* MEGAUserAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEGAUserAlert.h; sourceTree = "<group>"; };
5B23B7792164FC7C00600733 /* MEGAUserAlertList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MEGAUserAlertList.h; sourceTree = "<group>"; };
5B23B77A2164FC7C00600733 /* MEGAUserAlert.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MEGAUserAlert.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -301,6 +306,8 @@
A8EBFDD21EFAE14C00DF89DA /* MEGAEvent+init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MEGAEvent+init.h"; sourceTree = "<group>"; };
A8FD7B611E93B3ED0031FC50 /* osxutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = osxutils.h; path = osx/osxutils.h; sourceTree = "<group>"; };
A8FD7B631E93B40E0031FC50 /* osxutils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = osxutils.mm; path = ../../src/osx/osxutils.mm; sourceTree = "<group>"; };
B6657E9B225C2B6200EF8D91 /* raid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = raid.cpp; path = ../../src/raid.cpp; sourceTree = "<group>"; };
B6657E9D225C2BE600EF8D91 /* raid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = raid.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -352,6 +359,7 @@
41D143D91B5FC053000CA86F /* pendingcontactrequest.cpp */,
940BEFAA19ED92C2007E7FA2 /* proxy.cpp */,
940BEFAB19ED92C2007E7FA2 /* pubkeyaction.cpp */,
B6657E9B225C2B6200EF8D91 /* raid.cpp */,
940BEFAC19ED92C2007E7FA2 /* request.cpp */,
940BEFAD19ED92C2007E7FA2 /* serialize64.cpp */,
940BEFAE19ED92C2007E7FA2 /* share.cpp */,
Expand Down Expand Up @@ -476,6 +484,8 @@
A827F4DC204D3D14006A1962 /* MEGAFolderInfo.mm */,
A820A3082155111C00C8B6A5 /* MEGATimeZoneDetails.h */,
A820A3092155111C00C8B6A5 /* MEGATimeZoneDetails.mm */,
5B1D7CDD21F1E01E00B0215E /* MEGARecentActionBucket.h */,
5B1D7CE121F1E07200B0215E /* MEGARecentActionBucket.mm */,
);
name = bindings;
sourceTree = "<group>";
Expand Down Expand Up @@ -525,6 +535,7 @@
940BF06219EDBCAD007E7FA2 /* proxy.h */,
414820961C523B2D00552E76 /* pendingcontactrequest.h */,
940BF06319EDBCAD007E7FA2 /* pubkeyaction.h */,
B6657E9D225C2BE600EF8D91 /* raid.h */,
940BF06419EDBCAD007E7FA2 /* request.h */,
940BF06519EDBCAD007E7FA2 /* serialize64.h */,
940BF06619EDBCAD007E7FA2 /* share.h */,
Expand Down Expand Up @@ -630,6 +641,7 @@
A87D97A61F4AD9C300A98C0E /* MEGAAchievementsDetails+init.h */,
A827F4DE204D450E006A1962 /* MEGAFolderInfo+init.h */,
A808E4862158DAC400BDCE82 /* MEGATimeZoneDetails+init.h */,
5B0670CD21F5BABD00AD9F99 /* MEGARecentActionBucket+init.h */,
);
path = Private;
sourceTree = "<group>";
Expand Down Expand Up @@ -768,6 +780,7 @@
940BEFCD19ED92C2007E7FA2 /* share.cpp in Sources */,
940BEFC019ED92C2007E7FA2 /* filesystem.cpp in Sources */,
940BEFB919ED92C2007E7FA2 /* base64.cpp in Sources */,
B6657E9C225C2B6200EF8D91 /* raid.cpp in Sources */,
940BEFC819ED92C2007E7FA2 /* node.cpp in Sources */,
940BF00F19ED97B9007E7FA2 /* MEGASdk.mm in Sources */,
940BEFBC19ED92C2007E7FA2 /* db.cpp in Sources */,
Expand Down Expand Up @@ -805,6 +818,7 @@
940BEFCA19ED92C2007E7FA2 /* pubkeyaction.cpp in Sources */,
41AB68F21A094194003FE608 /* GfxProcCG.mm in Sources */,
940BEFEE19ED9351007E7FA2 /* external.cpp in Sources */,
5B1D7CE221F1E07200B0215E /* MEGARecentActionBucket.mm in Sources */,
940BEFD319ED92C2007E7FA2 /* user.cpp in Sources */,
940BEFEA19ED9351007E7FA2 /* cryptopp.cpp in Sources */,
940BF01919ED97B9007E7FA2 /* MEGAUserList.mm in Sources */,
Expand Down
58 changes: 41 additions & 17 deletions bindings/ios/MEGASdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@
#import <Foundation/Foundation.h>
#import <AssetsLibrary/AssetsLibrary.h>

#import "MEGANode.h"
#import "MEGAUser.h"
#import "MEGATransfer.h"
#import "MEGARequest.h"
#import "MEGAError.h"
#import "MEGAPricing.h"
#import "MEGAAccountDetails.h"
#import "MEGAAchievementsDetails.h"
#import "MEGAChildrenLists.h"
#import "MEGAContactRequest.h"
#import "MEGAEvent.h"
#import "MEGATransferList.h"
#import "MEGANodeList.h"
#import "MEGAUserList.h"
#import "MEGAShareList.h"
#import "MEGAContactRequestList.h"
#import "MEGAChildrenLists.h"
#import "MEGAAchievementsDetails.h"
#import "MEGARequestDelegate.h"
#import "MEGADelegate.h"
#import "MEGATransferDelegate.h"
#import "MEGAError.h"
#import "MEGAEvent.h"
#import "MEGAGlobalDelegate.h"
#import "MEGANodeList.h"
#import "MEGANode.h"
#import "MEGALoggerDelegate.h"
#import "MEGAPricing.h"
#import "MEGARecentActionBucket.h"
#import "MEGARequest.h"
#import "MEGARequestDelegate.h"
#import "MEGAShareList.h"
#import "MEGATransfer.h"
#import "MEGATransferDelegate.h"
#import "MEGATransferList.h"
#import "MEGATreeProcessorDelegate.h"
#import "MEGAUser.h"
#import "MEGAUserList.h"

typedef NS_ENUM (NSInteger, MEGASortOrderType) {
MEGASortOrderTypeNone,
Expand Down Expand Up @@ -5633,6 +5634,29 @@ typedef NS_ENUM(NSUInteger, StorageState) {
*/
- (MEGANodeList *)nodeListSearchForNode:(MEGANode *)node searchString:(NSString *)searchString;

/**
* @brief Return an array of buckets, each bucket containing a list of recently added/modified nodes
*
* Each bucket contains files that were added/modified in a set, by a single user.
* This function, that takes no parameters, uses the defaults for the MEGA apps
* which are (currently) within the last 30 days, and max 10000 nodes.
*
* @return Array of buckets containing nodes that were added/modifed as a set
*/
- (NSMutableArray *)recentActions;

/**
* @brief Return an array of buckets, each bucket containing a list of recently added/modified nodes
*
* Each bucket contains files that were added/modified in a set, by a single user.
*
* @param date Only return nodes that are more recent than this time.
* @param maxNodes Only return nodes up to this many.
*
* @return Array of buckets containing nodes that were added/modifed as a set
*/
- (NSMutableArray *)recentActionsSinceDays:(NSInteger)days maxNodes:(NSInteger)maxNodes;

/**
* @brief Process a node tree using a MEGATreeProcessorDelegate implementation
* @param node The parent node of the tree to explore
Expand Down Expand Up @@ -5997,7 +6021,7 @@ typedef NS_ENUM(NSUInteger, StorageState) {
* ready to accept connections. The initialization is synchronous.
*
* The server will serve files using this URL format:
* http://127.0.0.1/<NodeHandle>/<NodeName>
* http://[::1]/<NodeHandle>/<NodeName>
*
* The node name must be URL encoded and must match with the node handle.
* You can generate a correct link for a MEGANode using [MEGASdk httpServerGetLocalLink]
Expand All @@ -6018,7 +6042,7 @@ typedef NS_ENUM(NSUInteger, StorageState) {
*
* The HTTP server will only stream a node if it's allowed by all configuration options.
*
* @param localOnly YES to listen on 127.0.0.1 only, NO to listen on all network interfaces
* @param localOnly YES to listen on ::1 only, NO to listen on all network interfaces
* @param port Port in which the server must accept connections
* @return YES is the server is ready, NO if the initialization failed
*/
Expand Down
Loading

0 comments on commit 54bf12c

Please sign in to comment.