-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1427 from meganz/release/v3.5.1
Release/v3.5.1
- Loading branch information
Showing
76 changed files
with
6,534 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.