Merge branch 'dev' into light-mode

pull/249/head
nielsandriesse 5 years ago
commit d54bded164

@ -4096,7 +4096,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -4158,7 +4158,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
@ -4212,7 +4212,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
@ -4282,7 +4282,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
@ -4344,7 +4344,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -4407,7 +4407,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO; ENABLE_NS_ASSERTIONS = NO;
@ -4608,7 +4608,7 @@
CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements; CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -4676,7 +4676,7 @@
CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements; CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 102; CURRENT_PROJECT_VERSION = 103;
DEVELOPMENT_TEAM = SUQ8J2PCT7; DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",

@ -525,7 +525,7 @@ static NSTimeInterval launchStartedAt;
[[[OWSFailedMessagesJob alloc] initWithPrimaryStorage:self.primaryStorage] run]; [[[OWSFailedMessagesJob alloc] initWithPrimaryStorage:self.primaryStorage] run];
// Mark all "incomplete" calls as missed, e.g. any incoming or outgoing calls that were not // Mark all "incomplete" calls as missed, e.g. any incoming or outgoing calls that were not
// connected, failed or hung up before the app existed should be marked as missed. // connected, failed or hung up before the app existed should be marked as missed.
[[[OWSIncompleteCallsJob alloc] initWithPrimaryStorage:self.primaryStorage] run]; // [[[OWSIncompleteCallsJob alloc] initWithPrimaryStorage:self.primaryStorage] run];
[[[OWSFailedAttachmentDownloadsJob alloc] initWithPrimaryStorage:self.primaryStorage] run]; [[[OWSFailedAttachmentDownloadsJob alloc] initWithPrimaryStorage:self.primaryStorage] run];
}); });
} else { } else {
@ -534,7 +534,7 @@ static NSTimeInterval launchStartedAt;
// Unregistered user should have no unread messages. e.g. if you delete your account. // Unregistered user should have no unread messages. e.g. if you delete your account.
[AppEnvironment.shared.notificationPresenter clearAllNotifications]; [AppEnvironment.shared.notificationPresenter clearAllNotifications];
[self.socketManager requestSocketOpen]; // [self.socketManager requestSocketOpen];
UITapGestureRecognizer *gesture = UITapGestureRecognizer *gesture =
[[UITapGestureRecognizer alloc] initWithTarget:[Pastelog class] action:@selector(submitLogs)]; [[UITapGestureRecognizer alloc] initWithTarget:[Pastelog class] action:@selector(submitLogs)];
@ -548,8 +548,8 @@ static NSTimeInterval launchStartedAt;
// At this point, potentially lengthy DB locking migrations could be running. // At this point, potentially lengthy DB locking migrations could be running.
// Avoid blocking app launch by putting all further possible DB access in async block // Avoid blocking app launch by putting all further possible DB access in async block
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.socketManager requestSocketOpen]; // [self.socketManager requestSocketOpen];
[Environment.shared.contactsManager fetchSystemContactsOnceIfAlreadyAuthorized]; // [Environment.shared.contactsManager fetchSystemContactsOnceIfAlreadyAuthorized];
NSString *userPublicKey = self.tsAccountManager.localNumber; NSString *userPublicKey = self.tsAccountManager.localNumber;

@ -124,7 +124,9 @@ UIInterfaceOrientationMask DefaultUIInterfaceOrientationMask(void)
self.bottomLayoutView = view; self.bottomLayoutView = view;
if (avoidNotch) { if (avoidNotch) {
self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view withOffset:0]; NSLayoutConstraint *bottomLayoutConstraint = [view.bottomAnchor constraintEqualToAnchor:self.view.safeAreaLayoutGuide.bottomAnchor];
[bottomLayoutConstraint setActive:YES];
self.bottomLayoutConstraint = bottomLayoutConstraint;
} else { } else {
self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view]; self.bottomLayoutConstraint = [view autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:self.view];
} }

@ -378,19 +378,30 @@ typedef void (^AttachmentDownloadFailure)(NSError *error);
}); });
}; };
dispatch_async([OWSDispatch attachmentsQueue], ^{ __block NSUInteger retryCount = 0;
[self downloadFromLocation:attachmentPointer.downloadURL NSUInteger maxRetryCount = 4;
job:job __block void (^attempt)();
success:^(NSString *encryptedDataFilePath) { attempt = ^() {
[self decryptAttachmentPath:encryptedDataFilePath dispatch_async([OWSDispatch attachmentsQueue], ^{
attachmentPointer:attachmentPointer [self downloadFromLocation:attachmentPointer.downloadURL
success:markAndHandleSuccess job:job
failure:markAndHandleFailure]; success:^(NSString *encryptedDataFilePath) {
} [self decryptAttachmentPath:encryptedDataFilePath
failure:^(NSURLSessionTask *_Nullable task, NSError *error) { attachmentPointer:attachmentPointer
markAndHandleFailure(error); success:markAndHandleSuccess
}]; failure:markAndHandleFailure];
}); }
failure:^(NSURLSessionTask *task, NSError *error) {
if (retryCount == maxRetryCount) {
markAndHandleFailure(error);
} else {
retryCount += 1;
attempt();
}
}];
});
};
attempt();
} }
- (void)decryptAttachmentPath:(NSString *)encryptedDataFilePath - (void)decryptAttachmentPath:(NSString *)encryptedDataFilePath
@ -630,6 +641,7 @@ typedef void (^AttachmentDownloadFailure)(NSError *error);
} }
successHandler(tempFilePath); successHandler(tempFilePath);
}]; }];
[task resume]; [task resume];
} }

Loading…
Cancel
Save