diff --git a/src/Messages/Interactions/TSMessage.h b/src/Messages/Interactions/TSMessage.h index 15acdc0b9..7bba2b825 100644 --- a/src/Messages/Interactions/TSMessage.h +++ b/src/Messages/Interactions/TSMessage.h @@ -12,14 +12,6 @@ NS_ASSUME_NONNULL_BEGIN @class TSAttachmentPointer; -typedef NS_ENUM(NSInteger, TSGroupMetaMessage) { - TSGroupMessageNone, - TSGroupMessageNew, - TSGroupMessageUpdate, - TSGroupMessageDeliver, - TSGroupMessageQuit -}; - @interface TSMessage : TSInteraction @property (nonatomic, readonly) NSMutableArray *attachmentIds; diff --git a/src/Messages/Interactions/TSOutgoingMessage.h b/src/Messages/Interactions/TSOutgoingMessage.h index cf716b466..af4cac438 100644 --- a/src/Messages/Interactions/TSOutgoingMessage.h +++ b/src/Messages/Interactions/TSOutgoingMessage.h @@ -6,11 +6,6 @@ NS_ASSUME_NONNULL_BEGIN -@class OWSSignalServiceProtosAttachmentPointer; -@class OWSSignalServiceProtosDataMessageBuilder; - -@interface TSOutgoingMessage : TSMessage - typedef NS_ENUM(NSInteger, TSOutgoingMessageState) { // The message is either: // a) Enqueued for sending. @@ -26,8 +21,18 @@ typedef NS_ENUM(NSInteger, TSOutgoingMessageState) { TSOutgoingMessageStateSentToService, }; -- (instancetype)initWithTimestamp:(uint64_t)timestamp; -- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread; +typedef NS_ENUM(NSInteger, TSGroupMetaMessage) { + TSGroupMessageNone, + TSGroupMessageNew, + TSGroupMessageUpdate, + TSGroupMessageDeliver, + TSGroupMessageQuit +}; + +@class OWSSignalServiceProtosAttachmentPointer; +@class OWSSignalServiceProtosDataMessageBuilder; + +@interface TSOutgoingMessage : TSMessage - (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread @@ -37,11 +42,6 @@ typedef NS_ENUM(NSInteger, TSOutgoingMessageState) { inThread:(nullable TSThread *)thread groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage; -- (instancetype)initWithTimestamp:(uint64_t)timestamp - inThread:(nullable TSThread *)thread - messageBody:(nullable NSString *)body - attachmentIds:(NSMutableArray *)attachmentIds; - - (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread messageBody:(nullable NSString *)body diff --git a/src/Messages/Interactions/TSOutgoingMessage.m b/src/Messages/Interactions/TSOutgoingMessage.m index 479561d69..44bf46f72 100644 --- a/src/Messages/Interactions/TSOutgoingMessage.m +++ b/src/Messages/Interactions/TSOutgoingMessage.m @@ -65,11 +65,15 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec - (instancetype)initWithTimestamp:(uint64_t)timestamp { + OWSAssert(0); + return [self initWithTimestamp:timestamp inThread:nil]; } - (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread { + OWSAssert(0); + return [self initWithTimestamp:timestamp inThread:thread messageBody:nil]; } @@ -77,7 +81,11 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec inThread:(nullable TSThread *)thread messageBody:(nullable NSString *)body { - return [self initWithTimestamp:timestamp inThread:thread messageBody:body attachmentIds:[NSMutableArray new]]; + return [self initWithTimestamp:timestamp + inThread:thread + messageBody:body + attachmentIds:[NSMutableArray new] + expiresInSeconds:0]; } - (instancetype)initWithTimestamp:(uint64_t)timestamp @@ -85,6 +93,8 @@ NSString *const kTSOutgoingMessageSentRecipientAll = @"kTSOutgoingMessageSentRec messageBody:(nullable NSString *)body attachmentIds:(NSMutableArray *)attachmentIds { + OWSAssert(0); + return [self initWithTimestamp:timestamp inThread:thread messageBody:body