Skip to content

Commit

Permalink
Merge pull request #794 from meganz/release/v3.2.0
Browse files Browse the repository at this point in the history
Release/v3.2.0
  • Loading branch information
sergiohs84 authored Sep 4, 2017
2 parents 4edf31a + 6b26713 commit 3604ab7
Show file tree
Hide file tree
Showing 165 changed files with 27,089 additions and 1,877 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ MEGAcmdServer.pro.user
/contrib/QtCreator/MEGAcmd/MEGAcmdServer/MEGAcmd
/contrib/QtCreator/MEGAcmd/MEGAcmdServer/Makefile
/examples/mega-exec
/examples/megacmd/build/megacmd/debian.copyright
/examples/megacmd/client/mega-exec
/contrib/QtCreator/MEGAcmd/MEGAcmdLoader/MEGAcmdLoader
/contrib/QtCreator/MEGAcmd/MEGAcmdLoader/Makefile
/contrib/QtCreator/build-*
/examples/mega-cmd-server
49 changes: 49 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,52 @@ http://www.sqlite.org/
License: Public Domain

http://www.sqlite.org/copyright.html

### Libraries included in this repo

#### utf8proc
A clean C library for processing UTF-8 Unicode data

https://julialang.org/utf8proc/

License: MIT "expat" license

https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md

Files included in this repository based on `utf8proc`:
- `src/mega_utf8proc.cpp` (based on `utf8proc.c`)
- `src/mega_utf8proc_data.c` (based on `utf8proc_data.c`)
- `include/mega/mega_utf8proc.h` (based on `utf8proc.h`)
- `third_party/utf8proc/LICENSE` (copy of the licence of `utf8proc`)

#### http_parser
HTTP request/response parser for C

https://github.com/nodejs/http-parser

License: MIT

https://github.com/nodejs/http-parser/blob/master/LICENSE-MIT

Files included in this repository based on `http_parser`:
- `src/mega_http_parser.cpp` (based on `http_parser.c`)
- `include/mega/mega_http_parser.h` (based on `http_parser.h`)
- `third_party/http_parser/AUTHORS` (copy of the `AUTHORS` file of `http_parser`)
- `third_party/http_parser/LICENSE-MIT` (copy of the licence of `http_parser`)

#### zxcvbn-c
C/C++ version of the zxcvbn password strength estimator

https://github.com/tsyrogit/zxcvbn-c

License: MIT

https://github.com/tsyrogit/zxcvbn-c/blob/master/LICENSE.txt

Files included in this repository based on `zxcvbn-c`:
- `src/mega_zxcvbn.cpp` (based on `zxcvbn.c`)
- `include/mega/mega_zxcvbn.h` (based on `zxcvbn.h`)
- `include/mega/mega_dict-src.h` (dictionary file generated with the same wordlist as our webclient)
- `third_party/zxcvbn-c/README.md` (copy of the `README.MD` file of `zxcvbn-c`)
- `third_party/zxcvbn-c/LICENSE.txt` (copy of the licence of `zxcvbn-c`)

9 changes: 8 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The previous applies to all sources and binaries within the SDK save
those explicitly distributed under the terms of the GNU General Public
License (see http://www.gnu.org/copyleft/gpl.txt for details), and the
interactive MEGAcmdShell executables (mega-cmd in linux, MEGAcmdShell
in MAC and MEGAcmd.exe in Windows), distributed under the aforementioned
GNU General Public License.
241 changes: 241 additions & 0 deletions bindings/ios/MEGAAchievementsDetails.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
/**
* @file MEGAAchievementsDetails.h
* @brief Achievements that a user can unlock
*
* (c) 2017- 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>
#import "MEGAStringList.h"

typedef NS_ENUM(NSUInteger, MEGAAchievement) {
MEGAAchievementWelcome = 1,
MEGAAchievementInvite = 3,
MEGAAchievementDesktopInstall = 4,
MEGAAchievementMobileInstall = 5
};

/**
* @brief The MEGAAchievementsDetails class
*
* There are several MEGA Achievements that a user can unlock, resulting in a
* temporary extension of the storage and/or transfer quota during a period of
* time.
*
* Currently there are 4 different classes of MEGA Achievements:
*
* - Welcome: Create your free account and get 35 GB of complimentary storage space,
* valid for 30 days.
*
* - Invite: Invite as many friends or coworkers as you want. For every signup under the
* invited email address, you will receive 10 GB of complimentary storage plus 20 GB
* of transfer quota, both valid for 365 days, provided that the new user installs
* either MEGAsync or a mobile app and starts using MEGA.
*
* - Desktop install: When you install MEGAsync you get 20 GB of complimentary storage
* space plus 40 GB of transfer quota, both valid for 180 days.
*
* - Mobile install: When you install our mobile app you get 15 GB of complimentary
* storage space plus 30 GB transfer quota, both valid for 180 days.
*
* When the user unlocks one of the achievements above, it unlocks an "Award". The award
* includes a timestamps to indicate when it was unlocked, plus an expiration timestamp.
* Afterwards, the award will not be active. Additionally, each award results in a "Reward".
* The reward is linked to the corresponding award and includes the storage and transfer
* quota obtained thanks to the unlocked award.
*
* @note It may take 2-3 days for achievements to show on the account after they have been completed.
*/

@interface MEGAAchievementsDetails : NSObject

/**
* @brief The base storage value for this account, in bytes
*/
@property (nonatomic, readonly) long long baseStorage;

/**
* @brief Returns the actual storage achieved by this account
*
* This function considers the base storage (permanent) plus all the
* storage granted to the logged in account as result of the unlocked
* achievements. It does not consider the expired achievements.
*
* @return The achieved storage for this account
*/
@property (nonatomic, readonly) long long currentStorage;

/**
* @brief Returns the actual transfer quota achieved by this account
*
* This function considers all the transfer quota granted to the logged
* in account as result of the unlocked achievements. It does not consider
* the expired achievements.
*
* @return The achieved transfer quota for this account
*/
@property (nonatomic, readonly) long long currentTransfer;

/**
* @brief Returns the actual achieved storage due to referrals
*
* This function considers all the storage granted to the logged in account
* as result of the successful invitations (referrals). It does not consider
* the expired achievements.
*
* @return The achieved storage by this account as result of referrals
*/
@property (nonatomic, readonly) long long currentStorageReferrals;

/**
* @brief Returns the actual achieved transfer quota due to referrals
*
* This function considers all the transfer quota granted to the logged
* in account as result of the successful invitations (referrals). It
* does not consider the expired achievements.
*
* @return The transfer achieved quota by this account as result of referrals
*/
@property (nonatomic, readonly) long long currentTransferReferrals;


/**
* @brief The number of unlocked awards for this account
*/
@property (nonatomic, readonly) NSUInteger awardsCount;

/**
* @brief The number of active rewards for this account
*/
@property (nonatomic, readonly) NSInteger rewardsCount;

/**
* @brief Get the storage granted by a MEGA achievement class
*
* The following classes are valid:
* - MEGAAchievementWelcome = 1
* - MEGAAchievementInvite = 3
* - MEGAAchievementDesktopInstall = 4
* - MEGAAchievementMobileInstall = 5
*
* @param classId Id of the MEGA achievement
* @return Storage granted by this MEGA achievement class, in bytes
*/
- (long long)classStorageForClassId:(NSInteger)classId;

/**
* @brief Get the transfer quota granted by a MEGA achievement class
*
* The following classes are valid:
* - MEGAAchievementWelcome = 1
* - MEGAAchievementInvite = 3
* - MEGAAchievementDesktopInstall = 4
* - MEGAAchievementMobileInstall = 5
*
* @param classId Id of the MEGA achievement
* @return Transfer quota granted by this MEGA achievement class, in bytes
*/
- (long long)classTransferForClassId:(NSInteger)classId;

/**
* @brief Get the duration of storage/transfer quota granted by a MEGA achievement class
*
* The following classes are valid:
* - MEGAAchievementWelcome = 1
* - MEGAAchievementInvite = 3
* - MEGAAchievementDesktopInstall = 4
* - MEGAAchievementMobileInstall = 5
*
* The storage and transfer quota resulting from a MEGA achievement may expire after
* certain number of days. In example, the "Welcome" reward lasts for 30 days and afterwards
* the granted storage and transfer quota is revoked.
*
* @param classId Id of the MEGA achievement
* @return Number of days for the storage/transfer quota granted by this MEGA achievement class
*/
- (NSInteger)classExpireForClassId:(NSInteger)classId;

/**
* @brief Get the MEGA achievement class of the award
* @param index Position of the award in the list of unlocked awards
* @return The achievement class associated to the award in position \c index
*/
- (NSInteger)awardClassAtIndex:(NSUInteger)index;

/**
* @brief Get the id of the award
* @param index Position of the award in the list of unlocked awards
* @return The id of the award in position \c index
*/
- (NSInteger)awardIdAtIndex:(NSUInteger)index;

/**
* @brief Get the timestamp of the award (when it was unlocked)
* @param index Position of the award in the list of unlocked awards
* @return The timestamp of the award (when it was unlocked) in position \c index
*/
- (NSDate *)awardTimestampAtIndex:(NSUInteger)index;

/**
* @brief Get the expiration timestamp of the award
*
* After this moment, the storage and transfer quota granted as result of the award
* will not be valid anymore.
*
* @note The expiration time may not be the \c awardTimestamp plus the number of days
* returned by \c classExpireForClassId, since the award can be unlocked but not yet granted. It
* typically takes 2 days from unlocking the award until the user is actually rewarded.
*
* @param index Position of the award in the list of unlocked awards
* @return The expiration timestamp of the award in position \c index
*/
- (NSDate *)awardExpirationAtIndex:(NSUInteger)index;

/**
* @brief Get the list of referred emails for the award
*
* This function is specific for the achievements of class MEGAAchievementInvite.
*
* @param index Position of the award in the list of unlocked awards
* @return The list of invited emails for the award in position \c index
*/
- (MEGAStringList *)awardEmailsAtIndex:(NSUInteger)index;

/**
* @brief Get the storage rewarded by the award
* @param index Position of the reward in the list of active rewards
* @return The storage rewarded by the award
*/
- (long long)rewardStorageAtIndex:(NSUInteger)index;

/**
* @brief Get the transfer quota rewarded by the award
* @param index Position of the reward in the list of active rewards
* @return The transfer quota rewarded by the award
*/
- (long long)rewardTransferAtIndex:(NSUInteger)index;

/**
* @brief Get the duration of the reward
* @param index Position of the reward in the list of active rewards
* @return The duration of the reward, in days
*/
- (NSInteger)rewardExpireAtIndex:(NSUInteger)index;

- (instancetype)clone;

@end
Loading

0 comments on commit 3604ab7

Please sign in to comment.