session-ios/SignalMessaging/Models/TSUnreadIndicatorInteraction.m
Matthew Chen 8e4f2ca0ed Rework proto schema changes for quoted replies.
Sketch out model changes for quoted replies.

Sketch out quoted reply input preview.

Send quoted messages protos.

Update models to reflect quoted messages.

Rework interaction initializers.

Rework interaction initializers.

Add debug UI methods for generating quoted reply variations.

Add debug UI methods for generating quoted reply variations.
2018-04-02 16:17:46 -04:00

61 lines
1.3 KiB
Objective-C

//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSUnreadIndicatorInteraction.h"
NS_ASSUME_NONNULL_BEGIN
@interface TSUnreadIndicatorInteraction ()
@property (atomic) BOOL hasMoreUnseenMessages;
@end
#pragma mark -
@implementation TSUnreadIndicatorInteraction
- (instancetype)initWithCoder:(NSCoder *)coder
{
return [super initWithCoder:coder];
}
- (instancetype)initUnreadIndicatorWithTimestamp:(uint64_t)timestamp
thread:(TSThread *)thread
hasMoreUnseenMessages:(BOOL)hasMoreUnseenMessages
missingUnseenSafetyNumberChangeCount:(NSUInteger)missingUnseenSafetyNumberChangeCount
{
self = [super initInteractionWithTimestamp:timestamp inThread:thread];
if (!self) {
return self;
}
_hasMoreUnseenMessages = hasMoreUnseenMessages;
_missingUnseenSafetyNumberChangeCount = missingUnseenSafetyNumberChangeCount;
return self;
}
- (BOOL)shouldUseReceiptDateForSorting
{
// Use the timestamp, not the "received at" timestamp to sort,
// since we're creating these interactions after the fact and back-dating them.
return NO;
}
- (BOOL)isDynamicInteraction
{
return YES;
}
- (OWSInteractionType)interactionType
{
return OWSInteractionType_UnreadIndicator;
}
@end
NS_ASSUME_NONNULL_END