Fix SAE crash
This commit is contained in:
parent
9da8d1ac3f
commit
f27d0ef992
@ -232,6 +232,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
||||
|
||||
- (void)attachmentApproval:(AttachmentApprovalViewController *)approvalViewController
|
||||
didApproveAttachments:(NSArray<SignalAttachment *> *)attachments
|
||||
messageText:(NSString *_Nullable)messageText
|
||||
{
|
||||
[ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread];
|
||||
[self tryToSendMessageWithBlock:^(SendCompletionBlock sendCompletion) {
|
||||
@ -243,6 +244,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion);
|
||||
// SAE runs as long as it needs.
|
||||
// TODO ALBUMS - send album via SAE
|
||||
outgoingMessage = [ThreadUtil sendMessageNonDurablyWithAttachment:attachments.firstObject
|
||||
messageBody:messageText
|
||||
inThread:self.thread
|
||||
quotedReplyModel:nil
|
||||
messageSender:self.messageSender
|
||||
|
||||
@ -73,6 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// Used by SAE, otherwise we should use the durable `enqueue` counterpart
|
||||
+ (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment
|
||||
messageBody:(nullable NSString *)messageBody
|
||||
inThread:(TSThread *)thread
|
||||
quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel
|
||||
messageSender:(OWSMessageSender *)messageSender
|
||||
|
||||
@ -214,6 +214,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
}
|
||||
|
||||
+ (TSOutgoingMessage *)sendMessageNonDurablyWithAttachment:(SignalAttachment *)attachment
|
||||
messageBody:(nullable NSString *)messageBody
|
||||
inThread:(TSThread *)thread
|
||||
quotedReplyModel:(nullable OWSQuotedReplyModel *)quotedReplyModel
|
||||
messageSender:(OWSMessageSender *)messageSender
|
||||
@ -232,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
TSOutgoingMessage *message =
|
||||
[[TSOutgoingMessage alloc] initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp]
|
||||
inThread:thread
|
||||
messageBody:attachment.captionText
|
||||
messageBody:messageBody
|
||||
attachmentIds:[NSMutableArray new]
|
||||
expiresInSeconds:expiresInSeconds
|
||||
expireStartedAt:0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user