session-ios/SignalServiceKit/src/Messages/TSCall.h

45 lines
1.4 KiB
C
Raw Normal View History

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