From b6409dd514c279b0475d9012660491a389fe9e83 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 4 Apr 2018 10:58:49 -0400 Subject: [PATCH] CR: formatting changes // FREEBIE --- Signal/src/network/PushManager.m | 3 ++- SignalMessaging/utils/ThreadUtil.h | 2 +- SignalMessaging/utils/ThreadUtil.m | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Signal/src/network/PushManager.m b/Signal/src/network/PushManager.m index 812df552c..ebb433bdd 100644 --- a/Signal/src/network/PushManager.m +++ b/Signal/src/network/PushManager.m @@ -191,9 +191,10 @@ NSString *const Signal_Message_MarkAsRead_Identifier = @"Signal_Message_MarkAsRe TSThread *thread = [TSThread fetchObjectWithUniqueID:threadId]; NSString *replyText = responseInfo[UIUserNotificationActionResponseTypedTextKey]; + // TODO we could do an actual quoted reply here, but most apps don't. [ThreadUtil sendMessageWithText:replyText inThread:thread - quotedMessage:nil // TODO we could do an actual quoted reply here, but most apps don't. + quotedMessage:nil messageSender:self.messageSender success:^{ // TODO do we really want to mark them all as read? diff --git a/SignalMessaging/utils/ThreadUtil.h b/SignalMessaging/utils/ThreadUtil.h index 7225e3a84..85ccf8406 100644 --- a/SignalMessaging/utils/ThreadUtil.h +++ b/SignalMessaging/utils/ThreadUtil.h @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN + (TSOutgoingMessage *)sendMessageWithAttachment:(SignalAttachment *)attachment inThread:(TSThread *)thread - quotedMessage:quotedMessage + quotedMessage:(nullable TSQuotedMessage *)quotedMessage messageSender:(OWSMessageSender *)messageSender completion:(void (^_Nullable)(NSError *_Nullable error))completion; diff --git a/SignalMessaging/utils/ThreadUtil.m b/SignalMessaging/utils/ThreadUtil.m index a445a3584..9aeacbc5a 100644 --- a/SignalMessaging/utils/ThreadUtil.m +++ b/SignalMessaging/utils/ThreadUtil.m @@ -85,15 +85,18 @@ NS_ASSUME_NONNULL_BEGIN OWSDisappearingMessagesConfiguration *configuration = [OWSDisappearingMessagesConfiguration fetchObjectWithUniqueID:thread.uniqueId]; - TSOutgoingMessage *message = [[TSOutgoingMessage alloc] - initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp] - inThread:thread - messageBody:text - attachmentIds:[NSMutableArray new] - expiresInSeconds:(configuration.isEnabled ? configuration.durationSeconds : 0)expireStartedAt:0 - isVoiceMessage:NO - groupMetaMessage:TSGroupMessageNone - quotedMessage:quotedMessage]; + + uint32_t expiresInSeconds = (configuration.isEnabled ? configuration.durationSeconds : 0); + TSOutgoingMessage *message = + [[TSOutgoingMessage alloc] initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp] + inThread:thread + messageBody:text + attachmentIds:[NSMutableArray new] + expiresInSeconds:expiresInSeconds + expireStartedAt:0 + isVoiceMessage:NO + groupMetaMessage:TSGroupMessageNone + quotedMessage:quotedMessage]; [messageSender enqueueMessage:message success:successHandler failure:failureHandler];