session-ios/src/Messages/OWSUnknownContactBlockOfferMessage.m

55 lines
1.3 KiB
Mathematica
Raw Normal View History

//
// 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.
return self.date;
}
- (BOOL)isDynamicInteraction
{
return YES;
}
@end
NS_ASSUME_NONNULL_END