Path: blob/main/SignalServiceKit/Calls/Individual/TSCall.h
1 views
//1// Copyright 2018 Signal Messenger, LLC2// SPDX-License-Identifier: AGPL-3.0-only3//45#import <SignalServiceKit/OWSReadTracking.h>6#import <SignalServiceKit/TSInteraction.h>78NS_ASSUME_NONNULL_BEGIN910@class TSContactThread;1112typedef NS_ENUM(NSUInteger, RPRecentCallType) {13RPRecentCallTypeIncoming = 1,14RPRecentCallTypeOutgoing,15RPRecentCallTypeIncomingMissed,16// These call types are used until the call connects.17RPRecentCallTypeOutgoingIncomplete,18RPRecentCallTypeIncomingIncomplete,19RPRecentCallTypeIncomingMissedBecauseOfChangedIdentity,20RPRecentCallTypeIncomingDeclined,21RPRecentCallTypeOutgoingMissed,22RPRecentCallTypeIncomingAnsweredElsewhere,23RPRecentCallTypeIncomingDeclinedElsewhere,24RPRecentCallTypeIncomingBusyElsewhere,25RPRecentCallTypeIncomingMissedBecauseOfDoNotDisturb,26RPRecentCallTypeIncomingMissedBecauseBlockedSystemContact27};2829typedef NS_CLOSED_ENUM(NSUInteger, TSRecentCallOfferType) {30TSRecentCallOfferTypeAudio,31TSRecentCallOfferTypeVideo32};3334NSString *NSStringFromCallType(RPRecentCallType callType);3536/// Represents a 1:1 call-related update that lives in chat history.37///38/// A ``TSCall`` is associated with a ``CallRecord``. The ``CallRecord`` helps39/// bridge between "call IDs" used to identify this call across devices and40/// ``TSCall`` instances local to this device.41///42/// Not to be confused with an ``OutgoingCallMessage``.43@interface TSCall : TSInteraction <OWSPreviewText>4445/// Encodes both what kind of call it is, and the state of that call (pending, answered, missed, etc.)46/// Written to by CallKit callbacks, but also by incoming call event sync messages from linked47/// devices, by way of `CallRecord`.48@property (nonatomic) RPRecentCallType callType;49@property (nonatomic, readonly) TSRecentCallOfferType offerType;5051/// Whether this call has been read, or is "unread".52/// - SeeAlso ``OWSReadTracking``53@property (nonatomic, getter=wasRead) BOOL read;5455- (instancetype)initWithCustomUniqueId:(NSString *)uniqueId56timestamp:(uint64_t)timestamp57receivedAtTimestamp:(uint64_t)receivedAtTimestamp58thread:(TSThread *)thread NS_UNAVAILABLE;59- (instancetype)initWithTimestamp:(uint64_t)timestamp60receivedAtTimestamp:(uint64_t)receivedAtTimestamp61thread:(TSThread *)thread NS_UNAVAILABLE;62- (instancetype)initWithGrdbId:(int64_t)grdbId63uniqueId:(NSString *)uniqueId64receivedAtTimestamp:(uint64_t)receivedAtTimestamp65sortId:(uint64_t)sortId66timestamp:(uint64_t)timestamp67uniqueThreadId:(NSString *)uniqueThreadId NS_UNAVAILABLE;6869- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;7071- (instancetype)initWithCallType:(RPRecentCallType)callType72offerType:(TSRecentCallOfferType)offerType73thread:(TSContactThread *)thread74sentAtTimestamp:(uint64_t)sentAtTimestamp NS_DESIGNATED_INITIALIZER;7576// --- CODE GENERATION MARKER7778// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run79// `sds_codegen.sh`.8081// clang-format off8283- (instancetype)initWithGrdbId:(int64_t)grdbId84uniqueId:(NSString *)uniqueId85receivedAtTimestamp:(uint64_t)receivedAtTimestamp86sortId:(uint64_t)sortId87timestamp:(uint64_t)timestamp88uniqueThreadId:(NSString *)uniqueThreadId89callType:(RPRecentCallType)callType90offerType:(TSRecentCallOfferType)offerType91read:(BOOL)read92NS_DESIGNATED_INITIALIZER NS_SWIFT_NAME(init(grdbId:uniqueId:receivedAtTimestamp:sortId:timestamp:uniqueThreadId:callType:offerType:read:));9394// clang-format on9596// --- CODE GENERATION MARKER9798@end99100NS_ASSUME_NONNULL_END101102103