Skip to content

Commit 70ec28a

Browse files
committed
Merge branch 'release/3.7.1'
2 parents c9678b6 + 37371c5 commit 70ec28a

File tree

97 files changed

+5081
-1964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+5081
-1964
lines changed

MEGA.xcodeproj/project.pbxproj

+115-24
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#import "MEGABaseRequestDelegate.h"
3+
4+
@interface MEGACopyRequestDelegate : MEGABaseRequestDelegate
5+
6+
- (id)init NS_UNAVAILABLE;
7+
8+
- (instancetype)initToAttachToChatWithCompletion:(void (^)(void))completion;
9+
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
#import "MEGACopyRequestDelegate.h"
3+
4+
#import "SVProgressHUD.h"
5+
6+
@interface MEGACopyRequestDelegate ()
7+
8+
@property (nonatomic, copy) void (^completion)(void);
9+
10+
@end
11+
12+
@implementation MEGACopyRequestDelegate
13+
14+
#pragma mark - Initialization
15+
16+
- (instancetype)initToAttachToChatWithCompletion:(void (^)(void))completion {
17+
self = [super init];
18+
if (self) {
19+
_completion = completion;
20+
}
21+
22+
return self;
23+
}
24+
25+
#pragma mark - MEGARequestDelegate
26+
27+
- (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
28+
[super onRequestStart:api request:request];
29+
}
30+
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
31+
[super onRequestFinish:api request:request error:error];
32+
33+
if (error.type) {
34+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
35+
[SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"%@ %@", request.requestString, error.name]];
36+
return;
37+
}
38+
39+
if (self.completion) {
40+
self.completion();
41+
}
42+
}
43+
44+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#import "MEGABaseRequestDelegate.h"
3+
4+
@interface MEGACreateFolderRequestDelegate : MEGABaseRequestDelegate
5+
6+
- (id)init NS_UNAVAILABLE;
7+
8+
- (instancetype)initWithCompletion:(void (^)(void))completion;
9+
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
#import "MEGACreateFolderRequestDelegate.h"
3+
4+
#import "SVProgressHUD.h"
5+
6+
@interface MEGACreateFolderRequestDelegate ()
7+
8+
@property (nonatomic, copy) void (^completion)(void);
9+
10+
@end
11+
12+
@implementation MEGACreateFolderRequestDelegate
13+
14+
#pragma mark - Initialization
15+
16+
- (instancetype)initWithCompletion:(void (^)(void))completion {
17+
self = [super init];
18+
if (self) {
19+
_completion = completion;
20+
}
21+
22+
return self;
23+
}
24+
25+
#pragma mark - MEGARequestDelegate
26+
27+
- (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
28+
[super onRequestStart:api request:request];
29+
}
30+
31+
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
32+
[super onRequestFinish:api request:request error:error];
33+
34+
if (error.type) {
35+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
36+
[SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"%@ %@", request.requestString, error.name]];
37+
return;
38+
}
39+
40+
if (self.completion) {
41+
self.completion();
42+
}
43+
}
44+
45+
@end

iMEGA/API/Requests/MEGALoginRequestDelegate.m

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#import "LaunchViewController.h"
88

9+
#import "MEGAStore.h"
10+
911
@interface MEGALoginRequestDelegate ()
1012

1113
@property (nonatomic, getter=hasSession) BOOL session;
@@ -99,6 +101,7 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
99101
if (!self.hasSession) {
100102
NSString *session = [api dumpSession];
101103
[SAMKeychain setPassword:session forService:@"MEGA" account:@"sessionV3"];
104+
[[MEGAStore shareInstance] configureMEGAStore];
102105

103106
LaunchViewController *launchVC = [[UIStoryboard storyboardWithName:@"Launch" bundle:nil] instantiateViewControllerWithIdentifier:@"LaunchViewControllerID"];
104107
UIWindow *window = [[[UIApplication sharedApplication] delegate] window];

iMEGA/API/Requests/MEGASendSignupLinkRequestDelegate.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
4040
return;
4141
} else {
4242
[SAMKeychain setPassword:request.email forService:@"MEGA" account:@"email"];
43-
[SVProgressHUD showInfoWithStatus:AMLocalizedString(@"pleaseCheckYourEmail", nil)];
43+
[SVProgressHUD showInfoWithStatus:AMLocalizedString(@"awaitingEmailConfirmation", @"Title shown just after doing some action that requires confirming the action by an email")];
4444
}
4545
}
4646

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#import "MEGAStartUploadTransferDelegate.h"
3+
4+
@interface MEGAStartUploadTransferDelegate : NSObject <MEGATransferDelegate>
5+
6+
- (id)init NS_UNAVAILABLE;
7+
8+
- (instancetype)initToUploadToChatWithTotalBytes:(void (^)(long long totalBytes))totalBytes progress:(void (^)(float transferredBytes, float totalBytes))progress completion:(void (^)(long long totalBytes))completion;
9+
10+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
#import "MEGAStartUploadTransferDelegate.h"
3+
4+
@interface MEGAStartUploadTransferDelegate ()
5+
6+
@property (nonatomic, copy) void (^totalBytes)(long long totalBytes);
7+
@property (nonatomic, copy) void (^progress)(float transferredBytes, float totalBytes);
8+
@property (nonatomic, copy) void (^completion)(long long transferTotalBytes);
9+
10+
@end
11+
12+
@implementation MEGAStartUploadTransferDelegate
13+
14+
#pragma mark - Initialization
15+
16+
- (instancetype)initToUploadToChatWithTotalBytes:(void (^)(long long totalBytes))totalBytes progress:(void (^)(float transferredBytes, float totalBytes))progress completion:(void (^)(long long totalBytes))completion {
17+
self = [super init];
18+
if (self) {
19+
_totalBytes = totalBytes;
20+
_progress = progress;
21+
_completion = completion;
22+
}
23+
24+
return self;
25+
}
26+
27+
#pragma mark - MEGATransferDelegate
28+
29+
- (void)onTransferStart:(MEGASdk *)api transfer:(MEGATransfer *)transfer {
30+
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
31+
32+
if (self.totalBytes) {
33+
self.totalBytes(transfer.totalBytes.longLongValue);
34+
}
35+
}
36+
37+
- (void)onTransferUpdate:(MEGASdk *)api transfer:(MEGATransfer *)transfer {
38+
if (self.progress) {
39+
self.progress(transfer.transferredBytes.floatValue, transfer.totalBytes.floatValue);
40+
}
41+
}
42+
43+
- (void)onTransferFinish:(MEGASdk *)api transfer:(MEGATransfer *)transfer error:(MEGAError *)error {
44+
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
45+
46+
if (self.completion) {
47+
self.completion(transfer.totalBytes.longLongValue);
48+
}
49+
50+
if (error.type) return;
51+
}
52+
53+
@end

0 commit comments

Comments
 (0)