Signal-iOS/SignalServiceKit/src/Messages/OWSReadTracking.h
2021-06-07 11:11:30 -04:00

40 lines
1011 B
Objective-C

//
// Copyright (c) 2021 Open Whisper Systems. All rights reserved.
//
#import <SignalServiceKit/OWSReceiptManager.h>
NS_ASSUME_NONNULL_BEGIN
@class SDSAnyWriteTransaction;
/**
* Some interactions track read/unread status.
* e.g. incoming messages and call notifications
*/
@protocol OWSReadTracking <NSObject>
/**
* Has the local user seen the interaction?
*/
@property (nonatomic, readonly, getter=wasRead) BOOL read;
@property (nonatomic, readonly) uint64_t expireStartedAt;
@property (nonatomic, readonly) uint64_t sortId;
@property (nonatomic, readonly) NSString *uniqueThreadId;
- (BOOL)shouldAffectUnreadCounts;
/**
* Used both for *responding* to a remote read receipt and in response to the local user's activity.
*/
- (void)markAsReadAtTimestamp:(uint64_t)readTimestamp
thread:(TSThread *)thread
circumstance:(OWSReceiptCircumstance)circumstance
transaction:(SDSAnyWriteTransaction *)transaction;
@end
NS_ASSUME_NONNULL_END