Skip to content

Commit d8d14ae

Browse files
committed
Merge branch 'release/3.2.3-34'
2 parents e82044a + 3e7ffb2 commit d8d14ae

9 files changed

+101
-14
lines changed

iMEGA/AppDelegate.m

+21
Original file line numberDiff line numberDiff line change
@@ -1172,10 +1172,30 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
11721172
break;
11731173
}
11741174

1175+
1176+
case MEGAErrorTypeApiEBlocked: {
1177+
if ([request type] == MEGARequestTypeLogin || [request type] == MEGARequestTypeFetchNodes) {
1178+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"error", nil)
1179+
message:AMLocalizedString(@"accountBlocked", @"Error message when trying to login and the account is blocked")
1180+
delegate:self
1181+
cancelButtonTitle:AMLocalizedString(@"ok", nil)
1182+
otherButtonTitles:nil];
1183+
[alert show];
1184+
[api logout];
1185+
}
1186+
1187+
break;
1188+
}
1189+
11751190
default:
11761191
break;
11771192
}
11781193

1194+
if ([request type] == MEGARequestTypeExport) {
1195+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
1196+
[SVProgressHUD showErrorWithStatus:error.name];
1197+
}
1198+
11791199
if ([request type] == MEGARequestTypeSubmitPurchaseReceipt) {
11801200
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
11811201
[SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:AMLocalizedString(@"wrongPurchase", nil), [error name], (long)[error type]]];
@@ -1254,6 +1274,7 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
12541274
}
12551275
isFetchNodesDone = YES;
12561276

1277+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
12571278
[SVProgressHUD dismiss];
12581279

12591280
[self setBadgeValueForIncomingContactRequests];

iMEGA/Cloud drive/BrowserViewController.m

+4
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,10 @@ - (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
528528

529529
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
530530
if ([error type]) {
531+
if ([request type] == MEGARequestTypeMove || [request type] == MEGARequestTypeCopy) {
532+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
533+
[SVProgressHUD showErrorWithStatus:error.name];
534+
}
531535
return;
532536
}
533537

iMEGA/Cloud drive/CloudDriveTableViewController.m

+15-2
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,12 @@ - (void)reloadRowsAtIndexPaths:(NSArray *)indexPathsArray {
12651265
}
12661266
}
12671267

1268+
- (void)endEditingAndReloadSearch {
1269+
[self.searchDisplayController.searchResultsTableView setEditing:NO animated:YES];
1270+
[self filterContentForSearchText:self.searchDisplayController.searchBar.text];
1271+
[self.searchDisplayController.searchResultsTableView reloadData];
1272+
}
1273+
12681274
#pragma mark - IBActions
12691275

12701276
- (IBAction)selectAllAction:(UIBarButtonItem *)sender {
@@ -1620,6 +1626,11 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
16201626
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"permissionTitle", nil) message:AMLocalizedString(@"permissionMessage", nil) delegate:self cancelButtonTitle:AMLocalizedString(@"ok", nil) otherButtonTitles:nil, nil];
16211627
[alertView show];
16221628
}
1629+
} else {
1630+
if ([request type] == MEGARequestTypeMove || [request type] == MEGARequestTypeRemove) {
1631+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
1632+
[SVProgressHUD showErrorWithStatus:error.name];
1633+
}
16231634
}
16241635
return;
16251636
}
@@ -1672,7 +1683,8 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
16721683

16731684
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
16741685
[SVProgressHUD showImage:[UIImage imageNamed:@"hudRubbishBin"] status:message];
1675-
[self setEditing:NO animated:YES];
1686+
1687+
[self.searchDisplayController isActive] ? [self endEditingAndReloadSearch] : [self setEditing:NO animated:YES];
16761688
}
16771689
break;
16781690
}
@@ -1713,7 +1725,8 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
17131725
message = AMLocalizedString(@"shareFolderLeaved", @"Folder leave");
17141726
}
17151727
[SVProgressHUD showImage:[UIImage imageNamed:@"hudMinus"] status:message];
1716-
[self setEditing:NO animated:YES];
1728+
1729+
[self.searchDisplayController isActive] ? [self endEditingAndReloadSearch] : [self setEditing:NO animated:YES];
17171730
}
17181731
break;
17191732
}

iMEGA/Contacts/ContactRequestsViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ - (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button
448448
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
449449
if ([error type]) {
450450
if ([request type] == MEGARequestTypeInviteContact) {
451-
[SVProgressHUD showErrorWithStatus:AMLocalizedString(error.name, nil)];
451+
[SVProgressHUD showErrorWithStatus:error.name];
452452
}
453453
return;
454454
}

iMEGA/Contacts/ContactsViewController.m

+3-2
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,9 @@ - (void)emptyDataSet:(UIScrollView *)scrollView didTapButton:(UIButton *)button
10541054

10551055
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
10561056
if ([error type]) {
1057-
if ([request type] == MEGARequestTypeInviteContact) {
1058-
[SVProgressHUD showErrorWithStatus:AMLocalizedString(error.name, nil)];
1057+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
1058+
if ([request type] == MEGARequestTypeInviteContact || [request type] == MEGARequestTypeShare) {
1059+
[SVProgressHUD showErrorWithStatus:error.name];
10591060
}
10601061
return;
10611062
}

iMEGA/Info.plist

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<key>CFBundlePackageType</key>
3737
<string>APPL</string>
3838
<key>CFBundleShortVersionString</key>
39-
<string>3.2.2</string>
39+
<string>3.2.3</string>
4040
<key>CFBundleSignature</key>
4141
<string>????</string>
4242
<key>CFBundleURLTypes</key>
@@ -51,7 +51,7 @@
5151
</dict>
5252
</array>
5353
<key>CFBundleVersion</key>
54-
<string>33</string>
54+
<string>34</string>
5555
<key>LSRequiresIPhoneOS</key>
5656
<true/>
5757
<key>NSAppTransportSecurity</key>

iMEGA/Languages/Base.lproj/Localizable.strings

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@
7070
"createAccount"="Create Account";
7171
/* Message shown when the user writes a wrong email or password on login */
7272
"invalidMailOrPassword"="Invalid e-mail and/or password. Please try again";
73+
/* Error message when to many attempts to login */
74+
"tooManyAttemptsLogin"="You have attempted to log in too many times. Please wait until %@ and try again.";
75+
/* Error message when trying to login to an account not validated */
76+
"accountNotValidated"="Please check your e-mail and click the link to confirm your account";
77+
/* Error message when trying to login and the account is blocked */
78+
"accountBlocked"="Your account has been blocked. Please contact [email protected]";
7379
/* Message shown when the user writes an invalid format in the email field */
7480
"emailInvalidFormat"="Enter a valid email";
7581
/* Message shown when the user enters a wrong password */

iMEGA/Login/ConfirmAccountViewController.m

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
155155
}
156156

157157
case MEGAErrorTypeApiEAccess: {
158+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
158159
[SVProgressHUD dismiss];
159160
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"alreadyLoggedInAlertTitle", @"You are logged with another account")
160161
message:AMLocalizedString(@"alreadyLoggedInAlertMessage", @"If you agree, the current account will be logged out and all Offline data will be erased. Do you want to continue?")

iMEGA/Login/LoginViewController.m

+48-7
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ - (BOOL)validateEmail:(NSString *)email {
151151

152152
}
153153

154+
- (NSString *)timeFormatted:(NSUInteger)totalSeconds {
155+
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
156+
[formatter setDateStyle:NSDateFormatterNoStyle];
157+
[formatter setTimeStyle:NSDateFormatterMediumStyle];
158+
159+
NSDate *date = [NSDate dateWithTimeIntervalSinceNow:totalSeconds];
160+
161+
return [formatter stringFromDate:date];
162+
}
163+
154164
#pragma mark - UIResponder
155165

156166
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -198,11 +208,15 @@ -(BOOL)textFieldShouldReturn:(UITextField *)textField {
198208
#pragma mark - MEGARequestDelegate
199209

200210
- (void)onRequestStart:(MEGASdk *)api request:(MEGARequest *)request {
201-
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeClear];
211+
if ([request type] == MEGARequestTypeLogin) {
212+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
213+
[SVProgressHUD show];
214+
}
202215
}
203216

204217
- (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
205218
if ([error type]) {
219+
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];
206220
[SVProgressHUD dismiss];
207221
switch ([error type]) {
208222
case MEGAErrorTypeApiEArgs:
@@ -218,6 +232,39 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
218232
break;
219233
}
220234

235+
case MEGAErrorTypeApiETooMany: {
236+
NSString *message = [NSString stringWithFormat:AMLocalizedString(@"tooManyAttemptsLogin", @"Error message when to many attempts to login"), [self timeFormatted:3600]];
237+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"error", nil)
238+
message:message
239+
delegate:self
240+
cancelButtonTitle:AMLocalizedString(@"ok", nil)
241+
otherButtonTitles:nil];
242+
[alert show];
243+
244+
break;
245+
}
246+
247+
case MEGAErrorTypeApiEIncomplete: {
248+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"error", nil)
249+
message:AMLocalizedString(@"accountNotValidated", @"Error message when trying to login to an account not validated")
250+
delegate:self
251+
cancelButtonTitle:AMLocalizedString(@"ok", nil)
252+
otherButtonTitles:nil];
253+
[alert show];
254+
255+
break;
256+
}
257+
258+
case MEGAErrorTypeApiEBlocked: {
259+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:AMLocalizedString(@"error", nil)
260+
message:AMLocalizedString(@"accountBlocked", @"Error message when trying to login and the account is suspended")
261+
delegate:self
262+
cancelButtonTitle:AMLocalizedString(@"ok", nil)
263+
otherButtonTitles:nil];
264+
[alert show];
265+
break;
266+
}
267+
221268
default:
222269
break;
223270
}
@@ -244,10 +291,4 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
244291
}
245292
}
246293

247-
- (void)onRequestUpdate:(MEGASdk *)api request:(MEGARequest *)request {
248-
}
249-
250-
- (void)onRequestTemporaryError:(MEGASdk *)api request:(MEGARequest *)request error:(MEGAError *)error {
251-
}
252-
253294
@end

0 commit comments

Comments
 (0)