diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 5013b9208..6ae1e65ac 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -1890,7 +1890,11 @@ typedef enum : NSUInteger { // DEPRECATED: we're no longer creating these incoming SN error's per message, // but there will be some legacy ones in the wild, behind which await // as-of-yet-undecrypted messages +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) { +#pragma clang diagnostic pop + [errorMessage acceptNewIdentityKey]; } }]; diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index bf051074c..cad289c42 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -3598,11 +3598,14 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac withTransaction:transaction]]; [result addObject:[TSErrorMessage corruptedMessageWithEnvelope:[self createEnvelopeForThread:thread] withTransaction:transaction]]; - - + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" TSInvalidIdentityKeyReceivingErrorMessage *_Nullable blockingSNChangeMessage = [TSInvalidIdentityKeyReceivingErrorMessage untrustedKeyWithEnvelope:[self createEnvelopeForThread:thread] withTransaction:transaction]; +#pragma clang diagnostic pop + OWSAssertDebug(blockingSNChangeMessage); [result addObject:blockingSNChangeMessage]; // MJK TODO - should be safe to remove this senderTimestamp diff --git a/SignalMessaging/Models/OWSContactOffersInteraction.h b/SignalMessaging/Models/OWSContactOffersInteraction.h index 6c3d2839f..b3ee1de33 100644 --- a/SignalMessaging/Models/OWSContactOffersInteraction.h +++ b/SignalMessaging/Models/OWSContactOffersInteraction.h @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; -// MJK TODO Remove this timestamp param? +// MJK TODO should be safe to remove this timestamp param - (instancetype)initContactOffersWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread hasBlockOffer:(BOOL)hasBlockOffer diff --git a/SignalMessaging/Models/TSUnreadIndicatorInteraction.h b/SignalMessaging/Models/TSUnreadIndicatorInteraction.h index e1972b783..13a517c14 100644 --- a/SignalMessaging/Models/TSUnreadIndicatorInteraction.h +++ b/SignalMessaging/Models/TSUnreadIndicatorInteraction.h @@ -7,6 +7,7 @@ NS_ASSUME_NONNULL_BEGIN // This class is vestigial. +__attribute__((deprecated)) @interface TSUnreadIndicatorInteraction : TSInteraction - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; diff --git a/SignalMessaging/Models/TSUnreadIndicatorInteraction.m b/SignalMessaging/Models/TSUnreadIndicatorInteraction.m index afd976ef0..e9d96b4c9 100644 --- a/SignalMessaging/Models/TSUnreadIndicatorInteraction.m +++ b/SignalMessaging/Models/TSUnreadIndicatorInteraction.m @@ -6,7 +6,10 @@ NS_ASSUME_NONNULL_BEGIN +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation TSUnreadIndicatorInteraction +#pragma clang diagnostic pop - (instancetype)initWithCoder:(NSCoder *)coder { diff --git a/SignalMessaging/SignalMessaging.h b/SignalMessaging/SignalMessaging.h index 4d722d4e0..149f4a35a 100644 --- a/SignalMessaging/SignalMessaging.h +++ b/SignalMessaging/SignalMessaging.h @@ -49,7 +49,6 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[]; #import #import #import -#import #import #import #import diff --git a/SignalMessaging/utils/ThreadUtil.m b/SignalMessaging/utils/ThreadUtil.m index 3a58d803e..b17f22ffc 100644 --- a/SignalMessaging/utils/ThreadUtil.m +++ b/SignalMessaging/utils/ThreadUtil.m @@ -305,20 +305,31 @@ NS_ASSUME_NONNULL_BEGIN enumerateRowsInGroup:thread.uniqueId usingBlock:^( NSString *collection, NSString *key, id object, id metadata, NSUInteger index, BOOL *stop) { - +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if ([object isKindOfClass:[OWSUnknownContactBlockOfferMessage class]]) { +#pragma clang diagnostic pop // Delete this legacy interactions, which has been superseded by // the OWSContactOffersInteraction. [interactionsToDelete addObject:object]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" } else if ([object isKindOfClass:[OWSAddToContactsOfferMessage class]]) { +#pragma clang diagnostic pop // Delete this legacy interactions, which has been superseded by // the OWSContactOffersInteraction. [interactionsToDelete addObject:object]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" } else if ([object isKindOfClass:[OWSAddToProfileWhitelistOfferMessage class]]) { +#pragma clang diagnostic pop // Delete this legacy interactions, which has been superseded by // the OWSContactOffersInteraction. [interactionsToDelete addObject:object]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" } else if ([object isKindOfClass:[TSUnreadIndicatorInteraction class]]) { +#pragma clang diagnostic pop // Remove obsolete unread indicator interactions; [interactionsToDelete addObject:object]; } else if ([object isKindOfClass:[OWSContactOffersInteraction class]]) { @@ -465,7 +476,6 @@ NS_ASSUME_NONNULL_BEGIN = (shouldHaveBlockOffer || shouldHaveAddToContactsOffer || shouldHaveAddToProfileWhitelistOffer); if (isContactThread) { TSContactThread *contactThread = (TSContactThread *)thread; - // MJK only place where `hasDismissedOffers` is read if (contactThread.hasDismissedOffers) { shouldHaveContactOffers = NO; } diff --git a/SignalServiceKit/src/Contacts/TSThread.h b/SignalServiceKit/src/Contacts/TSThread.h index 3adefacbf..8812ee0cb 100644 --- a/SignalServiceKit/src/Contacts/TSThread.h +++ b/SignalServiceKit/src/Contacts/TSThread.h @@ -58,7 +58,10 @@ NS_ASSUME_NONNULL_BEGIN /** * Get all messages in the thread we weren't able to decrypt */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (NSArray *)receivedMessagesForInvalidKey:(NSData *)key; +#pragma clang diagnostic pop - (NSUInteger)unreadMessageCountWithTransaction:(YapDatabaseReadTransaction *)transaction NS_SWIFT_NAME(unreadMessageCount(transaction:)); diff --git a/SignalServiceKit/src/Contacts/TSThread.m b/SignalServiceKit/src/Contacts/TSThread.m index 56daa1f89..768b1e751 100644 --- a/SignalServiceKit/src/Contacts/TSThread.m +++ b/SignalServiceKit/src/Contacts/TSThread.m @@ -206,6 +206,8 @@ NS_ASSUME_NONNULL_BEGIN return [interactions copy]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (NSArray *)receivedMessagesForInvalidKey:(NSData *)key { NSMutableArray *errorMessages = [NSMutableArray new]; @@ -220,6 +222,7 @@ NS_ASSUME_NONNULL_BEGIN return [errorMessages copy]; } +#pragma clang diagnostic pop - (NSUInteger)numberOfInteractions { diff --git a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m index c3230e9c8..b9e3a60a6 100644 --- a/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m +++ b/SignalServiceKit/src/Devices/OWSRecordTranscriptJob.m @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN if (transcript.isEndSessionMessage) { OWSLogInfo(@"EndSession was sent to recipient: %@.", transcript.recipientId); [self.primaryStorage deleteAllSessionsForContact:transcript.recipientId protocolContext:transaction]; - // MJK TODO - verify we can delete this senderTimestamp + // MJK TODO - we don't use this timestamp, safe to remove [[[TSInfoMessage alloc] initWithSenderTimestamp:transcript.timestamp inThread:transcript.thread messageType:TSInfoMessageTypeSessionDidEnd] diff --git a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h index 4db3613ee..03c7f89f2 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h +++ b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.h @@ -51,10 +51,6 @@ typedef NS_ENUM(int32_t, TSErrorMessageType) { failedMessageType:(TSErrorMessageType)errorMessageType recipientId:(nullable NSString *)recipientId NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithSenderTimestamp:(uint64_t)timestamp - inThread:(nullable TSThread *)thread - failedMessageType:(TSErrorMessageType)errorMessageType; - + (instancetype)corruptedMessageWithEnvelope:(SSKProtoEnvelope *)envelope withTransaction:(YapDatabaseReadWriteTransaction *)transaction; diff --git a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m index 99578de7d..2935d6e40 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m +++ b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage.m @@ -91,18 +91,11 @@ NSUInteger TSErrorMessageSchemaVersion = 1; TSContactThread *contactThread = [TSContactThread getOrCreateThreadWithContactId:envelope.source transaction:transaction]; - // MJK FIXME - cannot rely on envelope timestamp for sorting, ensure this is saved immediately. + // Legit usage of senderTimestamp. We don't actually currently surface it in the UI, but it serves as + // a reference to the envelope which we failed to process. return [self initWithSenderTimestamp:envelope.timestamp inThread:contactThread failedMessageType:errorMessageType]; } -- (instancetype)initWithFailedMessageType:(TSErrorMessageType)errorMessageType -{ - // MJK FIXME - cannot rely on envelope timestamp for sorting, ensure this is saved immediately. - return [self initWithSenderTimestamp:[NSDate ows_millisecondTimeStamp] - inThread:nil - failedMessageType:errorMessageType]; -} - - (OWSInteractionType)interactionType { return OWSInteractionType_Error; @@ -160,7 +153,10 @@ NSUInteger TSErrorMessageSchemaVersion = 1; + (instancetype)corruptedMessageInUnknownThread { - return [[self alloc] initWithFailedMessageType:TSErrorMessageInvalidMessage]; + // MJK TODO - Seems like we could safely remove this timestamp + return [[self alloc] initWithSenderTimestamp:[NSDate ows_millisecondTimeStamp] + inThread:nil + failedMessageType:TSErrorMessageInvalidMessage]; } + (instancetype)invalidVersionWithEnvelope:(SSKProtoEnvelope *)envelope diff --git a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage_privateConstructor.h b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage_privateConstructor.h index 5b5c851c2..1cb4a6f82 100644 --- a/SignalServiceKit/src/Messages/Interactions/TSErrorMessage_privateConstructor.h +++ b/SignalServiceKit/src/Messages/Interactions/TSErrorMessage_privateConstructor.h @@ -4,17 +4,16 @@ #import "TSErrorMessage.h" +NS_ASSUME_NONNULL_BEGIN + @interface TSErrorMessage () - (instancetype)initWithSenderTimestamp:(uint64_t)timestamp - inThread:(TSThread *)thread + inThread:(nullable TSThread *)thread failedMessageType:(TSErrorMessageType)errorMessageType NS_DESIGNATED_INITIALIZER; @property (atomic, nullable) NSData *envelopeData; -@property NSDictionary *pendingOutgoingMessage; - -#define TSPendingOutgoingMessageKey @"TSPendingOutgoingMessageKey" -#define TSPendingOutgoingMessageRecipientKey @"TSPendingOutgoingMessageRecipientKey" - @end + +NS_ASSUME_NONNULL_END diff --git a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.h b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.h index 8aca7e224..de4f023aa 100644 --- a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.h +++ b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.h @@ -10,10 +10,13 @@ NS_ASSUME_NONNULL_BEGIN // DEPRECATED - we no longer create new instances of this class (as of mid-2017); However, existing instances may // exist, so we should keep this class around to honor their old behavior. +__attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage : TSInvalidIdentityKeyErrorMessage +#ifdef DEBUG + (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope withTransaction:(YapDatabaseReadWriteTransaction *)transaction; +#endif @end diff --git a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m index ea9abcbc0..d0ed5a33b 100644 --- a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m +++ b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN -/// TODO we can eventually deprecate this, since incoming messages are now always decrypted. +__attribute__((deprecated)) @interface TSInvalidIdentityKeyReceivingErrorMessage () @property (nonatomic, readonly, copy) NSString *authorId; @@ -33,13 +33,16 @@ NS_ASSUME_NONNULL_BEGIN @synthesize envelopeData = _envelopeData; +#ifdef DEBUG +// We no longer create these messages, but they might exist on legacy clients so it's useful to be able to +// create them with the debug UI + (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope withTransaction:(YapDatabaseReadWriteTransaction *)transaction { TSContactThread *contactThread = [TSContactThread getOrCreateThreadWithContactId:envelope.source transaction:transaction]; - // MJK - FIXME, can't rely on envelope.timestamp for sorting, ensure this is saved immediately. + // Legit usage of senderTimestamp, references message which failed to decrypt TSInvalidIdentityKeyReceivingErrorMessage *errorMessage = [[self alloc] initForUnknownIdentityKeyWithSenderTimestamp:envelope.timestamp inThread:contactThread @@ -69,6 +72,7 @@ NS_ASSUME_NONNULL_BEGIN return self; } +#endif - (nullable SSKProtoEnvelope *)envelope { diff --git a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.h b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.h index 08efb2214..dd9e9f7c0 100644 --- a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.h +++ b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "TSInvalidIdentityKeyErrorMessage.h" @@ -13,6 +13,9 @@ NS_ASSUME_NONNULL_BEGIN extern NSString *TSInvalidPreKeyBundleKey; extern NSString *TSInvalidRecipientKey; +// DEPRECATED - we no longer create new instances of this class (as of mid-2017); However, existing instances may +// exist, so we should keep this class around to honor their old behavior. +__attribute__((deprecated)) @interface TSInvalidIdentityKeySendingErrorMessage : TSInvalidIdentityKeyErrorMessage @property (nonatomic, readonly) NSString *messageId; diff --git a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.m b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.m index 883b75bab..43f792c68 100644 --- a/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.m +++ b/SignalServiceKit/src/Messages/InvalidKeyMessages/TSInvalidIdentityKeySendingErrorMessage.m @@ -24,27 +24,12 @@ NSString *TSInvalidRecipientKey = @"TSInvalidRecipientKey"; @end +// DEPRECATED - we no longer create new instances of this class (as of mid-2017); However, existing instances may +// exist, so we should keep this class around to honor their old behavior. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation TSInvalidIdentityKeySendingErrorMessage - -- (instancetype)initWithOutgoingMessage:(TSOutgoingMessage *)message - inThread:(TSThread *)thread - forRecipient:(NSString *)recipientId - preKeyBundle:(PreKeyBundle *)preKeyBundle -{ - // We want the error message to appear after the message. - // MJK FIXME - we can't rely on sort order like this. - self = [super initWithSenderTimestamp:message.timestamp + 1 - inThread:thread - failedMessageType:TSErrorMessageWrongTrustedIdentityKey - recipientId:recipientId]; - - if (self) { - _messageId = message.uniqueId; - _preKeyBundle = preKeyBundle; - } - - return self; -} +#pragma clang diagnostic pop - (void)acceptNewIdentityKey { diff --git a/SignalServiceKit/src/Messages/OWSAddToContactsOfferMessage.m b/SignalServiceKit/src/Messages/OWSAddToContactsOfferMessage.m index 4d5c2a4e4..8def83eb5 100644 --- a/SignalServiceKit/src/Messages/OWSAddToContactsOfferMessage.m +++ b/SignalServiceKit/src/Messages/OWSAddToContactsOfferMessage.m @@ -16,7 +16,10 @@ NS_ASSUME_NONNULL_BEGIN // This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation OWSAddToContactsOfferMessage +#pragma clang diagnostic pop + (instancetype)addToContactsOfferMessageWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread diff --git a/SignalServiceKit/src/Messages/OWSAddToProfileWhitelistOfferMessage.m b/SignalServiceKit/src/Messages/OWSAddToProfileWhitelistOfferMessage.m index 15b0716d9..d2da5716a 100644 --- a/SignalServiceKit/src/Messages/OWSAddToProfileWhitelistOfferMessage.m +++ b/SignalServiceKit/src/Messages/OWSAddToProfileWhitelistOfferMessage.m @@ -9,7 +9,10 @@ NS_ASSUME_NONNULL_BEGIN // This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation OWSAddToProfileWhitelistOfferMessage +#pragma clang diagnostic pop + (instancetype)addToProfileWhitelistOfferMessageWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread { diff --git a/SignalServiceKit/src/Messages/OWSIdentityManager.m b/SignalServiceKit/src/Messages/OWSIdentityManager.m index a0846302b..4f992d4d9 100644 --- a/SignalServiceKit/src/Messages/OWSIdentityManager.m +++ b/SignalServiceKit/src/Messages/OWSIdentityManager.m @@ -528,6 +528,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa [messages addObject:[TSErrorMessage nonblockingIdentityChangeInThread:groupThread recipientId:recipientId]]; } + // MJK TODO - why not save immediately, why build up this array? for (TSMessage *message in messages) { [message saveWithTransaction:transaction]; } diff --git a/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.h b/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.h index b04b240f3..1fd3f2a47 100644 --- a/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.h +++ b/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.h @@ -8,11 +8,8 @@ NS_ASSUME_NONNULL_BEGIN // This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject) -__attribute__((deprecated)) @interface OWSUnknownContactBlockOfferMessage : TSErrorMessage - -+ (instancetype)unknownContactBlockOfferMessageWithSenderTimestamp:(uint64_t)timestamp - thread:(TSThread *)thread - contactId:(NSString *)contactId; +__attribute__((deprecated)) +@interface OWSUnknownContactBlockOfferMessage : TSErrorMessage @property (nonatomic, readonly) NSString *contactId; diff --git a/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.m b/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.m index 3a72df442..3d11291cf 100644 --- a/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.m +++ b/SignalServiceKit/src/Messages/OWSUnknownContactBlockOfferMessage.m @@ -16,29 +16,10 @@ NS_ASSUME_NONNULL_BEGIN // This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-implementations" @implementation OWSUnknownContactBlockOfferMessage - -+ (instancetype)unknownContactBlockOfferMessageWithSenderTimestamp:(uint64_t)timestamp - thread:(TSThread *)thread - contactId:(NSString *)contactId -{ - return [[OWSUnknownContactBlockOfferMessage alloc] initWithSenderTimestamp:timestamp - thread:thread - contactId:contactId]; -} - -- (instancetype)initWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread contactId:(NSString *)contactId -{ - self = [super initWithSenderTimestamp:timestamp - inThread:thread - failedMessageType:TSErrorMessageUnknownContactBlockOffer]; - - if (self) { - _contactId = contactId; - } - - return self; -} +#pragma clang diagnostic pop - (BOOL)shouldUseReceiptDateForSorting {