Remove legacy Error backdating - no changes in functionality

Historically we would backdate the SN change messages, but since adopting
non-blocking SN changes long ago, they're already sorted properly by creation
time, so backdating has been unnecessary for a while.

I also audited that all other error messages are saved directly after creation.

I applied deprecation attributes as appropriate as I audited.
pull/1/head
Michael Kirk 7 years ago
parent 550e7ba63b
commit 00d0d1e002

@ -1890,7 +1890,11 @@ typedef enum : NSUInteger {
// DEPRECATED: we're no longer creating these incoming SN error's per message, // 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 // but there will be some legacy ones in the wild, behind which await
// as-of-yet-undecrypted messages // as-of-yet-undecrypted messages
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) { if ([errorMessage isKindOfClass:[TSInvalidIdentityKeyReceivingErrorMessage class]]) {
#pragma clang diagnostic pop
[errorMessage acceptNewIdentityKey]; [errorMessage acceptNewIdentityKey];
} }
}]; }];

@ -3598,11 +3598,14 @@ typedef OWSContact * (^OWSContactBlock)(YapDatabaseReadWriteTransaction *transac
withTransaction:transaction]]; withTransaction:transaction]];
[result addObject:[TSErrorMessage corruptedMessageWithEnvelope:[self createEnvelopeForThread:thread] [result addObject:[TSErrorMessage corruptedMessageWithEnvelope:[self createEnvelopeForThread:thread]
withTransaction:transaction]]; withTransaction:transaction]];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
TSInvalidIdentityKeyReceivingErrorMessage *_Nullable blockingSNChangeMessage = TSInvalidIdentityKeyReceivingErrorMessage *_Nullable blockingSNChangeMessage =
[TSInvalidIdentityKeyReceivingErrorMessage untrustedKeyWithEnvelope:[self createEnvelopeForThread:thread] [TSInvalidIdentityKeyReceivingErrorMessage untrustedKeyWithEnvelope:[self createEnvelopeForThread:thread]
withTransaction:transaction]; withTransaction:transaction];
#pragma clang diagnostic pop
OWSAssertDebug(blockingSNChangeMessage); OWSAssertDebug(blockingSNChangeMessage);
[result addObject:blockingSNChangeMessage]; [result addObject:blockingSNChangeMessage];
// MJK TODO - should be safe to remove this senderTimestamp // MJK TODO - should be safe to remove this senderTimestamp

@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; - (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 - (instancetype)initContactOffersWithSenderTimestamp:(uint64_t)timestamp
thread:(TSThread *)thread thread:(TSThread *)thread
hasBlockOffer:(BOOL)hasBlockOffer hasBlockOffer:(BOOL)hasBlockOffer

@ -7,6 +7,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
// This class is vestigial. // This class is vestigial.
__attribute__((deprecated))
@interface TSUnreadIndicatorInteraction : TSInteraction @interface TSUnreadIndicatorInteraction : TSInteraction
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; - (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;

@ -6,7 +6,10 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-implementations"
@implementation TSUnreadIndicatorInteraction @implementation TSUnreadIndicatorInteraction
#pragma clang diagnostic pop
- (instancetype)initWithCoder:(NSCoder *)coder - (instancetype)initWithCoder:(NSCoder *)coder
{ {

@ -49,7 +49,6 @@ FOUNDATION_EXPORT const unsigned char SignalMessagingVersionString[];
#import <SignalMessaging/SelectRecipientViewController.h> #import <SignalMessaging/SelectRecipientViewController.h>
#import <SignalMessaging/SharingThreadPickerViewController.h> #import <SignalMessaging/SharingThreadPickerViewController.h>
#import <SignalMessaging/SignalKeyingStorage.h> #import <SignalMessaging/SignalKeyingStorage.h>
#import <SignalMessaging/TSUnreadIndicatorInteraction.h>
#import <SignalMessaging/Theme.h> #import <SignalMessaging/Theme.h>
#import <SignalMessaging/ThreadUtil.h> #import <SignalMessaging/ThreadUtil.h>
#import <SignalMessaging/ThreadViewHelper.h> #import <SignalMessaging/ThreadViewHelper.h>

@ -305,20 +305,31 @@ NS_ASSUME_NONNULL_BEGIN
enumerateRowsInGroup:thread.uniqueId enumerateRowsInGroup:thread.uniqueId
usingBlock:^( usingBlock:^(
NSString *collection, NSString *key, id object, id metadata, NSUInteger index, BOOL *stop) { 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]]) { if ([object isKindOfClass:[OWSUnknownContactBlockOfferMessage class]]) {
#pragma clang diagnostic pop
// Delete this legacy interactions, which has been superseded by // Delete this legacy interactions, which has been superseded by
// the OWSContactOffersInteraction. // the OWSContactOffersInteraction.
[interactionsToDelete addObject:object]; [interactionsToDelete addObject:object];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
} else if ([object isKindOfClass:[OWSAddToContactsOfferMessage class]]) { } else if ([object isKindOfClass:[OWSAddToContactsOfferMessage class]]) {
#pragma clang diagnostic pop
// Delete this legacy interactions, which has been superseded by // Delete this legacy interactions, which has been superseded by
// the OWSContactOffersInteraction. // the OWSContactOffersInteraction.
[interactionsToDelete addObject:object]; [interactionsToDelete addObject:object];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
} else if ([object isKindOfClass:[OWSAddToProfileWhitelistOfferMessage class]]) { } else if ([object isKindOfClass:[OWSAddToProfileWhitelistOfferMessage class]]) {
#pragma clang diagnostic pop
// Delete this legacy interactions, which has been superseded by // Delete this legacy interactions, which has been superseded by
// the OWSContactOffersInteraction. // the OWSContactOffersInteraction.
[interactionsToDelete addObject:object]; [interactionsToDelete addObject:object];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
} else if ([object isKindOfClass:[TSUnreadIndicatorInteraction class]]) { } else if ([object isKindOfClass:[TSUnreadIndicatorInteraction class]]) {
#pragma clang diagnostic pop
// Remove obsolete unread indicator interactions; // Remove obsolete unread indicator interactions;
[interactionsToDelete addObject:object]; [interactionsToDelete addObject:object];
} else if ([object isKindOfClass:[OWSContactOffersInteraction class]]) { } else if ([object isKindOfClass:[OWSContactOffersInteraction class]]) {
@ -465,7 +476,6 @@ NS_ASSUME_NONNULL_BEGIN
= (shouldHaveBlockOffer || shouldHaveAddToContactsOffer || shouldHaveAddToProfileWhitelistOffer); = (shouldHaveBlockOffer || shouldHaveAddToContactsOffer || shouldHaveAddToProfileWhitelistOffer);
if (isContactThread) { if (isContactThread) {
TSContactThread *contactThread = (TSContactThread *)thread; TSContactThread *contactThread = (TSContactThread *)thread;
// MJK only place where `hasDismissedOffers` is read
if (contactThread.hasDismissedOffers) { if (contactThread.hasDismissedOffers) {
shouldHaveContactOffers = NO; shouldHaveContactOffers = NO;
} }

@ -58,7 +58,10 @@ NS_ASSUME_NONNULL_BEGIN
/** /**
* Get all messages in the thread we weren't able to decrypt * Get all messages in the thread we weren't able to decrypt
*/ */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (NSArray<TSInvalidIdentityKeyReceivingErrorMessage *> *)receivedMessagesForInvalidKey:(NSData *)key; - (NSArray<TSInvalidIdentityKeyReceivingErrorMessage *> *)receivedMessagesForInvalidKey:(NSData *)key;
#pragma clang diagnostic pop
- (NSUInteger)unreadMessageCountWithTransaction:(YapDatabaseReadTransaction *)transaction - (NSUInteger)unreadMessageCountWithTransaction:(YapDatabaseReadTransaction *)transaction
NS_SWIFT_NAME(unreadMessageCount(transaction:)); NS_SWIFT_NAME(unreadMessageCount(transaction:));

@ -206,6 +206,8 @@ NS_ASSUME_NONNULL_BEGIN
return [interactions copy]; return [interactions copy];
} }
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (NSArray<TSInvalidIdentityKeyReceivingErrorMessage *> *)receivedMessagesForInvalidKey:(NSData *)key - (NSArray<TSInvalidIdentityKeyReceivingErrorMessage *> *)receivedMessagesForInvalidKey:(NSData *)key
{ {
NSMutableArray *errorMessages = [NSMutableArray new]; NSMutableArray *errorMessages = [NSMutableArray new];
@ -220,6 +222,7 @@ NS_ASSUME_NONNULL_BEGIN
return [errorMessages copy]; return [errorMessages copy];
} }
#pragma clang diagnostic pop
- (NSUInteger)numberOfInteractions - (NSUInteger)numberOfInteractions
{ {

@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN
if (transcript.isEndSessionMessage) { if (transcript.isEndSessionMessage) {
OWSLogInfo(@"EndSession was sent to recipient: %@.", transcript.recipientId); OWSLogInfo(@"EndSession was sent to recipient: %@.", transcript.recipientId);
[self.primaryStorage deleteAllSessionsForContact:transcript.recipientId protocolContext:transaction]; [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 [[[TSInfoMessage alloc] initWithSenderTimestamp:transcript.timestamp
inThread:transcript.thread inThread:transcript.thread
messageType:TSInfoMessageTypeSessionDidEnd] messageType:TSInfoMessageTypeSessionDidEnd]

@ -51,10 +51,6 @@ typedef NS_ENUM(int32_t, TSErrorMessageType) {
failedMessageType:(TSErrorMessageType)errorMessageType failedMessageType:(TSErrorMessageType)errorMessageType
recipientId:(nullable NSString *)recipientId NS_DESIGNATED_INITIALIZER; recipientId:(nullable NSString *)recipientId NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithSenderTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
failedMessageType:(TSErrorMessageType)errorMessageType;
+ (instancetype)corruptedMessageWithEnvelope:(SSKProtoEnvelope *)envelope + (instancetype)corruptedMessageWithEnvelope:(SSKProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction; withTransaction:(YapDatabaseReadWriteTransaction *)transaction;

@ -91,18 +91,11 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
TSContactThread *contactThread = TSContactThread *contactThread =
[TSContactThread getOrCreateThreadWithContactId:envelope.source transaction:transaction]; [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]; 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 - (OWSInteractionType)interactionType
{ {
return OWSInteractionType_Error; return OWSInteractionType_Error;
@ -160,7 +153,10 @@ NSUInteger TSErrorMessageSchemaVersion = 1;
+ (instancetype)corruptedMessageInUnknownThread + (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 + (instancetype)invalidVersionWithEnvelope:(SSKProtoEnvelope *)envelope

@ -4,17 +4,16 @@
#import "TSErrorMessage.h" #import "TSErrorMessage.h"
NS_ASSUME_NONNULL_BEGIN
@interface TSErrorMessage () @interface TSErrorMessage ()
- (instancetype)initWithSenderTimestamp:(uint64_t)timestamp - (instancetype)initWithSenderTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread inThread:(nullable TSThread *)thread
failedMessageType:(TSErrorMessageType)errorMessageType NS_DESIGNATED_INITIALIZER; failedMessageType:(TSErrorMessageType)errorMessageType NS_DESIGNATED_INITIALIZER;
@property (atomic, nullable) NSData *envelopeData; @property (atomic, nullable) NSData *envelopeData;
@property NSDictionary *pendingOutgoingMessage;
#define TSPendingOutgoingMessageKey @"TSPendingOutgoingMessageKey"
#define TSPendingOutgoingMessageRecipientKey @"TSPendingOutgoingMessageRecipientKey"
@end @end
NS_ASSUME_NONNULL_END

@ -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 // 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. // exist, so we should keep this class around to honor their old behavior.
__attribute__((deprecated))
@interface TSInvalidIdentityKeyReceivingErrorMessage : TSInvalidIdentityKeyErrorMessage @interface TSInvalidIdentityKeyReceivingErrorMessage : TSInvalidIdentityKeyErrorMessage
#ifdef DEBUG
+ (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope + (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction; withTransaction:(YapDatabaseReadWriteTransaction *)transaction;
#endif
@end @end

@ -19,7 +19,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
/// TODO we can eventually deprecate this, since incoming messages are now always decrypted. __attribute__((deprecated))
@interface TSInvalidIdentityKeyReceivingErrorMessage () @interface TSInvalidIdentityKeyReceivingErrorMessage ()
@property (nonatomic, readonly, copy) NSString *authorId; @property (nonatomic, readonly, copy) NSString *authorId;
@ -33,13 +33,16 @@ NS_ASSUME_NONNULL_BEGIN
@synthesize envelopeData = _envelopeData; @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 + (nullable instancetype)untrustedKeyWithEnvelope:(SSKProtoEnvelope *)envelope
withTransaction:(YapDatabaseReadWriteTransaction *)transaction withTransaction:(YapDatabaseReadWriteTransaction *)transaction
{ {
TSContactThread *contactThread = TSContactThread *contactThread =
[TSContactThread getOrCreateThreadWithContactId:envelope.source transaction:transaction]; [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 = TSInvalidIdentityKeyReceivingErrorMessage *errorMessage =
[[self alloc] initForUnknownIdentityKeyWithSenderTimestamp:envelope.timestamp [[self alloc] initForUnknownIdentityKeyWithSenderTimestamp:envelope.timestamp
inThread:contactThread inThread:contactThread
@ -69,6 +72,7 @@ NS_ASSUME_NONNULL_BEGIN
return self; return self;
} }
#endif
- (nullable SSKProtoEnvelope *)envelope - (nullable SSKProtoEnvelope *)envelope
{ {

@ -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" #import "TSInvalidIdentityKeyErrorMessage.h"
@ -13,6 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString *TSInvalidPreKeyBundleKey; extern NSString *TSInvalidPreKeyBundleKey;
extern NSString *TSInvalidRecipientKey; 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 @interface TSInvalidIdentityKeySendingErrorMessage : TSInvalidIdentityKeyErrorMessage
@property (nonatomic, readonly) NSString *messageId; @property (nonatomic, readonly) NSString *messageId;

@ -24,27 +24,12 @@ NSString *TSInvalidRecipientKey = @"TSInvalidRecipientKey";
@end @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 @implementation TSInvalidIdentityKeySendingErrorMessage
#pragma clang diagnostic pop
- (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;
}
- (void)acceptNewIdentityKey - (void)acceptNewIdentityKey
{ {

@ -16,7 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
// This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // 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) // 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 @implementation OWSAddToContactsOfferMessage
#pragma clang diagnostic pop
+ (instancetype)addToContactsOfferMessageWithSenderTimestamp:(uint64_t)timestamp + (instancetype)addToContactsOfferMessageWithSenderTimestamp:(uint64_t)timestamp
thread:(TSThread *)thread thread:(TSThread *)thread

@ -9,7 +9,10 @@ NS_ASSUME_NONNULL_BEGIN
// This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // 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) // 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 @implementation OWSAddToProfileWhitelistOfferMessage
#pragma clang diagnostic pop
+ (instancetype)addToProfileWhitelistOfferMessageWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread + (instancetype)addToProfileWhitelistOfferMessageWithSenderTimestamp:(uint64_t)timestamp thread:(TSThread *)thread
{ {

@ -528,6 +528,7 @@ NSString *const kNSNotificationName_IdentityStateDidChange = @"kNSNotificationNa
[messages addObject:[TSErrorMessage nonblockingIdentityChangeInThread:groupThread recipientId:recipientId]]; [messages addObject:[TSErrorMessage nonblockingIdentityChangeInThread:groupThread recipientId:recipientId]];
} }
// MJK TODO - why not save immediately, why build up this array?
for (TSMessage *message in messages) { for (TSMessage *message in messages) {
[message saveWithTransaction:transaction]; [message saveWithTransaction:transaction];
} }

@ -8,11 +8,8 @@ NS_ASSUME_NONNULL_BEGIN
// This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // 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) // TODO - remove this class, clean up existing instances, ensure any missed ones don't explode (UnknownDBObject)
__attribute__((deprecated)) @interface OWSUnknownContactBlockOfferMessage : TSErrorMessage __attribute__((deprecated))
@interface OWSUnknownContactBlockOfferMessage : TSErrorMessage
+ (instancetype)unknownContactBlockOfferMessageWithSenderTimestamp:(uint64_t)timestamp
thread:(TSThread *)thread
contactId:(NSString *)contactId;
@property (nonatomic, readonly) NSString *contactId; @property (nonatomic, readonly) NSString *contactId;

@ -16,29 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
// This is a deprecated class, we're keeping it around to avoid YapDB serialization errors // 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) // 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 @implementation OWSUnknownContactBlockOfferMessage
#pragma clang diagnostic pop
+ (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;
}
- (BOOL)shouldUseReceiptDateForSorting - (BOOL)shouldUseReceiptDateForSorting
{ {

Loading…
Cancel
Save