Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
signalapp
GitHub Repository: signalapp/Signal-iOS
Path: blob/main/SignalServiceKit/Messages/OWSReadTracking.h
1 views
1
//
2
// Copyright 2017 Signal Messenger, LLC
3
// SPDX-License-Identifier: AGPL-3.0-only
4
//
5
6
NS_ASSUME_NONNULL_BEGIN
7
8
@class DBWriteTransaction;
9
@class TSThread;
10
11
typedef NS_CLOSED_ENUM(NSInteger, OWSReceiptCircumstance) {
12
OWSReceiptCircumstanceOnLinkedDevice,
13
OWSReceiptCircumstanceOnLinkedDeviceWhilePendingMessageRequest,
14
OWSReceiptCircumstanceOnThisDevice,
15
OWSReceiptCircumstanceOnThisDeviceWhilePendingMessageRequest
16
};
17
18
/**
19
* Some interactions track read/unread status.
20
* e.g. incoming messages and call notifications
21
*/
22
@protocol OWSReadTracking <NSObject>
23
24
/**
25
* Has the local user seen the interaction?
26
*/
27
@property (nonatomic, readonly, getter=wasRead) BOOL read;
28
29
@property (nonatomic, readonly) NSString *uniqueId;
30
@property (nonatomic, readonly) uint64_t expireStartedAt;
31
@property (nonatomic, readonly) uint64_t sortId;
32
@property (nonatomic, readonly) NSString *uniqueThreadId;
33
34
35
/**
36
* Used both for *responding* to a remote read receipt and in response to the local user's activity.
37
*/
38
- (void)markAsReadAtTimestamp:(uint64_t)readTimestamp
39
thread:(TSThread *)thread
40
circumstance:(OWSReceiptCircumstance)circumstance
41
shouldClearNotifications:(BOOL)shouldClearNotifications
42
transaction:(DBWriteTransaction *)transaction;
43
44
@end
45
46
NS_ASSUME_NONNULL_END
47
48