Skip to content

Commit

Permalink
Merge branch 'release/4.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jnavarrom committed Oct 3, 2018
2 parents b688869 + 31eddb8 commit f164b75
Show file tree
Hide file tree
Showing 95 changed files with 2,242 additions and 970 deletions.
4 changes: 2 additions & 2 deletions MEGA.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4336,7 +4336,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
Expand Down Expand Up @@ -4386,7 +4386,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "-DNDEBUG";
OTHER_LDFLAGS = "-ObjC";
Expand Down
2 changes: 1 addition & 1 deletion iMEGA/API/Requests/MEGAShareRequestDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
[SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeNone];

if (self.isChangingPermissions) {
if (request.access == MEGAShareTypeAccessUnkown) {
if (request.access == MEGAShareTypeAccessUnknown) {
if (self.totalRequests > 1) {
[SVProgressHUD showImage:[UIImage imageNamed:@"hudForbidden"] status:AMLocalizedString(@"sharesRemoved", @"Message shown when some shares have been removed")];
} else {
Expand Down
19 changes: 19 additions & 0 deletions iMEGA/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2387,6 +2387,25 @@ - (void)onRequestFinish:(MEGASdk *)api request:(MEGARequest *)request error:(MEG
[[MEGAStore shareInstance] insertUserWithUserHandle:user.handle firstname:nil lastname:request.text email:user.email];
}
}
} else {
MOUser *moUser = [[MEGAStore shareInstance] fetchUserWithEmail:request.email];
if (moUser) {
if (request.paramType == MEGAUserAttributeFirstname && ![request.text isEqualToString:moUser.firstname]) {
[[MEGAStore shareInstance] updateUserWithEmail:request.email firstname:request.text];
}

if (request.paramType == MEGAUserAttributeLastname && ![request.text isEqualToString:moUser.lastname]) {
[[MEGAStore shareInstance] updateUserWithEmail:request.email lastname:request.text];
}
} else {
if (request.paramType == MEGAUserAttributeFirstname) {
[[MEGAStore shareInstance] insertUserWithUserHandle:~(uint64_t)0 firstname:request.text lastname:nil email:request.email];
}

if (request.paramType == MEGAUserAttributeLastname) {
[[MEGAStore shareInstance] insertUserWithUserHandle:~(uint64_t)0 firstname:nil lastname:request.text email:request.email];
}
}
}
break;
}
Expand Down
62 changes: 41 additions & 21 deletions iMEGA/Camera uploads/Photos.storyboard

Large diffs are not rendered by default.

26 changes: 9 additions & 17 deletions iMEGA/Categories/MEGANode+MNZCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,15 @@ - (UIViewController *)mnz_viewControllerForNodeInFolderLink:(BOOL)isFolderLink {
return alertController;
}
} else {
if (api.downloadTransfers.size.integerValue > 0) {
UIAlertController *documentOpeningAlertController = [UIAlertController alertControllerWithTitle:AMLocalizedString(@"documentOpening_alertTitle", @"Alert title shown when you try to open a Cloud Drive document and is not posible because there's some active download") message:AMLocalizedString(@"documentOpening_alertMessage", @"Alert message shown when you try to open a Cloud Drive document and is not posible because there's some active download") preferredStyle:UIAlertControllerStyleAlert];

[documentOpeningAlertController addAction:[UIAlertAction actionWithTitle:AMLocalizedString(@"ok", nil) style:UIAlertActionStyleCancel handler:nil]];

return documentOpeningAlertController;
} else {
if ([Helper isFreeSpaceEnoughToDownloadNode:self isFolderLink:isFolderLink]) {
MEGANavigationController *navigationController = [[UIStoryboard storyboardWithName:@"Cloud" bundle:nil] instantiateViewControllerWithIdentifier:@"previewDocumentNavigationID"];
PreviewDocumentViewController *previewController = navigationController.viewControllers.firstObject;
previewController.node = self;
previewController.api = api;
previewController.isLink = isFolderLink;
return navigationController;
}
return nil;
if ([Helper isFreeSpaceEnoughToDownloadNode:self isFolderLink:isFolderLink]) {
MEGANavigationController *navigationController = [[UIStoryboard storyboardWithName:@"Cloud" bundle:nil] instantiateViewControllerWithIdentifier:@"previewDocumentNavigationID"];
PreviewDocumentViewController *previewController = navigationController.viewControllers.firstObject;
previewController.node = self;
previewController.api = api;
previewController.isLink = isFolderLink;
return navigationController;
}
return nil;
}
}

Expand Down Expand Up @@ -298,7 +290,7 @@ - (void)mnz_removeSharing {

MEGAShareRequestDelegate *shareRequestDelegate = [[MEGAShareRequestDelegate alloc] initToChangePermissionsWithNumberOfRequests:outSharesForNodeMutableArray.count completion:nil];
for (MEGAShare *share in outSharesForNodeMutableArray) {
[[MEGASdkManager sharedMEGASdk] shareNode:self withEmail:share.user level:MEGAShareTypeAccessUnkown delegate:shareRequestDelegate];
[[MEGASdkManager sharedMEGASdk] shareNode:self withEmail:share.user level:MEGAShareTypeAccessUnknown delegate:shareRequestDelegate];
}
}

Expand Down
30 changes: 28 additions & 2 deletions iMEGA/Categories/NSString+MNZCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,35 @@
@implementation NSString (MNZCategory)

- (BOOL)mnz_isImagePathExtension {
NSSet *imagesExtensionsSet = [[NSSet alloc] initWithObjects:@"gif", @"jpg", @"tif", @"jpeg", @"bmp", @"png", @"nef", @"heic", nil];
NSArray<NSString *> *supportedExtensions = @[@"bmp",
@"cr2",
@"crw",
@"cur",
@"dng",
@"gif",
@"heic",
@"ico",
@"j2c",
@"jp2",
@"jpf",
@"jpeg",
@"jpg",
@"nef",
@"orf",
@"pbm",
@"pgm",
@"png",
@"pnm",
@"ppm",
@"psd",
@"raf",
@"rw2",
@"rwl",
@"tga",
@"tif",
@"tiff"];

return [imagesExtensionsSet containsObject:self.pathExtension.lowercaseString];
return [supportedExtensions containsObject:self.pathExtension.lowercaseString];
}

- (BOOL)mnz_isVideoPathExtension {
Expand Down
6 changes: 6 additions & 0 deletions iMEGA/Categories/UIDevice+MNZCategory.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ + (NSDictionary *)devicesDictionary {
@"iPhone10,4":@"iPhone 8", //iPhone 8
@"iPhone10,5":@"iPhone 8 Plus", //iPhone 8 Plus
@"iPhone10,6":@"iPhone X", //iPhone X
@"iPhone11,2":@"iPhone XS", //iPhone XS
@"iPhone11,4":@"iPhone XS Max", //iPhone XS Max
@"iPhone11,6":@"iPhone XS Max", //iPhone XS Max
@"iPhone11,8":@"iPhone XR", //iPhone XR
@"iPad1,1":@"iPad", //iPad (Original/1st Gen) (Wi-Fi/3G/GPS)
@"iPad2,1":@"iPad", //iPad 2 (Wi-Fi Only)
@"iPad2,2":@"iPad", //iPad 2 (Wi-Fi/GSM/GPS)
Expand All @@ -70,6 +74,8 @@ + (NSDictionary *)devicesDictionary {
@"iPad3,6":@"iPad", //iPad (4th Generation) (Wi-Fi/Verizon & Sprint/GPS)
@"iPad6,11":@"iPad", //iPad (5th Generation) (Wi-Fi)
@"iPad6,12":@"iPad", //iPad (5th Generation) (Cellular)
@"iPad7,5":@"iPad", //iPad (6th Generation) (Wi-Fi)
@"iPad7,6":@"iPad", //iPad (6th Generation) (Cellular)
@"iPad4,1":@"iPad Air", //iPad Air (5th Generation) (Wi-Fi)
@"iPad4,2":@"iPad Air", //iPad Air (5th Generation) (Cellular)
@"iPad4,3":@"iPad Air", //iPad Air (5th Generation) (Wi-Fi/TD-LTE - China)
Expand Down
Loading

0 comments on commit f164b75

Please sign in to comment.