2017-04-10 02:53:45 +02:00
|
|
|
//
|
|
|
|
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "OWSUnknownContactBlockOfferMessage.h"
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
|
|
|
@interface OWSUnknownContactBlockOfferMessage ()
|
|
|
|
|
|
|
|
@property (nonatomic) NSString *contactId;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
@implementation OWSUnknownContactBlockOfferMessage
|
|
|
|
|
|
|
|
+ (instancetype)unknownContactBlockOfferMessage:(uint64_t)timestamp
|
|
|
|
thread:(TSThread *)thread
|
|
|
|
contactId:(NSString *)contactId
|
|
|
|
{
|
|
|
|
return [[OWSUnknownContactBlockOfferMessage alloc] initWithTimestamp:timestamp thread:thread contactId:contactId];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (instancetype)initWithTimestamp:(uint64_t)timestamp thread:(TSThread *)thread contactId:(NSString *)contactId
|
|
|
|
{
|
|
|
|
self = [super initWithTimestamp:timestamp inThread:thread failedMessageType:TSErrorMessageUnknownContactBlockOffer];
|
|
|
|
|
|
|
|
if (self) {
|
|
|
|
_contactId = contactId;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (nullable NSDate *)receiptDateForSorting
|
|
|
|
{
|
|
|
|
// Always use date, since we're creating these interactions after the fact
|
|
|
|
// and back-dating them.
|
2017-04-10 20:39:02 +02:00
|
|
|
//
|
|
|
|
// By default [TSMessage receiptDateForSorting] will prefer to use receivedAtDate
|
|
|
|
// which is not back-dated.
|
2017-04-10 02:53:45 +02:00
|
|
|
return self.date;
|
|
|
|
}
|
|
|
|
|
2017-05-23 16:12:04 +02:00
|
|
|
- (BOOL)isDynamicInteraction
|
|
|
|
{
|
|
|
|
return YES;
|
|
|
|
}
|
|
|
|
|
2017-04-10 02:53:45 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|