Merge branch 'mkirk/sae-crash' into hotfix/2.32.2

pull/1/head
Michael Kirk 6 years ago
commit b0318f59d1

@ -232,6 +232,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
- (void)attachmentApproval:(AttachmentApprovalViewController *)approvalViewController - (void)attachmentApproval:(AttachmentApprovalViewController *)approvalViewController
didApproveAttachments:(NSArray<SignalAttachment *> *)attachments didApproveAttachments:(NSArray<SignalAttachment *> *)attachments
messageText:(NSString *_Nullable)messageText
{ {
[ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread]; [ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread];
[self tryToSendMessageWithBlock:^(SendCompletionBlock sendCompletion) { [self tryToSendMessageWithBlock:^(SendCompletionBlock sendCompletion) {
@ -243,6 +244,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
// SAE runs as long as it needs. // SAE runs as long as it needs.
// TODO ALBUMS - send album via SAE // TODO ALBUMS - send album via SAE
outgoingMessage = [ThreadUtil sendMessageNonDurablyWithAttachment:attachments.firstObject outgoingMessage = [ThreadUtil sendMessageNonDurablyWithAttachment:attachments.firstObject
messageBody:messageText
inThread:self.thread inThread:self.thread
quotedReplyModel:nil quotedReplyModel:nil
messageSender:self.messageSender messageSender:self.messageSender

@ -73,6 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
// Used by SAE, otherwise we should use the durable `enqueue` counterpart // Used by SAE, otherwise we should use the durable `enqueue` counterpart
+ (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment + (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment
messageBody:(nullable NSString *)messageBody
inThread:(TSThread *)thread inThread:(TSThread *)thread
quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel
messageSender:(OWSMessageSender *)messageSender messageSender:(OWSMessageSender *)messageSender

@ -214,6 +214,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
+ (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment + (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment
messageBody:(nullable NSString *)messageBody
inThread:(TSThread *)thread inThread:(TSThread *)thread
quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel
messageSender:(OWSMessageSender *)messageSender messageSender:(OWSMessageSender *)messageSender
@ -232,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN
TSOutgoingMessage *message = TSOutgoingMessage *message =
[[TSOutgoingMessage alloc] initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp] [[TSOutgoingMessage alloc] initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp]
inThread:thread inThread:thread
messageBody:attachment.captionText messageBody:messageBody
attachmentIds:[NSMutableArray new] attachmentIds:[NSMutableArray new]
expiresInSeconds:expiresInSeconds expiresInSeconds:expiresInSeconds
expireStartedAt:0 expireStartedAt:0

Loading…
Cancel
Save