2017-02-07 21:09:04 +01:00
|
|
|
//
|
2018-02-07 18:44:09 +01:00
|
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
2017-02-07 21:09:04 +01:00
|
|
|
//
|
2015-12-07 03:31:43 +01:00
|
|
|
|
2017-02-07 21:09:04 +01:00
|
|
|
#import "OWSReadTracking.h"
|
2015-12-07 03:31:43 +01:00
|
|
|
#import "TSInteraction.h"
|
|
|
|
|
2016-12-18 22:08:26 +01:00
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2016-07-28 01:58:49 +02:00
|
|
|
@class TSContactThread;
|
|
|
|
|
2015-12-07 03:31:43 +01:00
|
|
|
typedef enum {
|
|
|
|
RPRecentCallTypeIncoming = 1,
|
|
|
|
RPRecentCallTypeOutgoing,
|
2018-07-11 15:58:02 +02:00
|
|
|
RPRecentCallTypeIncomingMissed,
|
2017-02-08 21:51:53 +01:00
|
|
|
// These call types are used until the call connects.
|
|
|
|
RPRecentCallTypeOutgoingIncomplete,
|
|
|
|
RPRecentCallTypeIncomingIncomplete,
|
2018-07-11 15:58:02 +02:00
|
|
|
RPRecentCallTypeIncomingMissedBecauseOfChangedIdentity,
|
|
|
|
RPRecentCallTypeIncomingDeclined,
|
|
|
|
RPRecentCallTypeOutgoingMissed,
|
2015-12-07 03:31:43 +01:00
|
|
|
} RPRecentCallType;
|
|
|
|
|
2018-07-11 15:58:02 +02:00
|
|
|
NSString *NSStringFromCallType(RPRecentCallType callType);
|
|
|
|
|
2018-04-21 19:45:45 +02:00
|
|
|
@interface TSCall : TSInteraction <OWSReadTracking, OWSPreviewText>
|
2015-12-07 03:31:43 +01:00
|
|
|
|
|
|
|
@property (nonatomic, readonly) RPRecentCallType callType;
|
|
|
|
|
2018-02-07 18:44:09 +01:00
|
|
|
- (instancetype)initInteractionWithTimestamp:(uint64_t)timestamp inThread:(TSThread *)thread NS_UNAVAILABLE;
|
|
|
|
|
2016-12-18 22:08:26 +01:00
|
|
|
- (instancetype)initWithTimestamp:(uint64_t)timestamp
|
2015-12-07 03:31:43 +01:00
|
|
|
withCallNumber:(NSString *)contactNumber
|
|
|
|
callType:(RPRecentCallType)callType
|
2017-02-07 21:09:04 +01:00
|
|
|
inThread:(TSContactThread *)thread NS_DESIGNATED_INITIALIZER;
|
|
|
|
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
|
2015-12-07 03:31:43 +01:00
|
|
|
|
2017-02-08 21:51:53 +01:00
|
|
|
- (void)updateCallType:(RPRecentCallType)callType;
|
2018-07-11 15:58:02 +02:00
|
|
|
- (void)updateCallType:(RPRecentCallType)callType transaction:(YapDatabaseReadWriteTransaction *)transaction;
|
2017-02-08 21:51:53 +01:00
|
|
|
|
2015-12-07 03:31:43 +01:00
|
|
|
@end
|
2016-12-18 22:08:26 +01:00
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|