session-ios/SignalServiceKit/src/Contacts/Threads/TSContactThread.h

33 lines
955 B
Objective-C

//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSThread.h"
NS_ASSUME_NONNULL_BEGIN
@interface TSContactThread : TSThread
@property (nonatomic) BOOL hasDismissedOffers;
+ (instancetype)getOrCreateThreadWithContactId:(NSString *)contactId NS_SWIFT_NAME(getOrCreateThread(contactId:));
+ (instancetype)getOrCreateThreadWithContactId:(NSString *)contactId
transaction:(YapDatabaseReadWriteTransaction *)transaction;
// Unlike getOrCreateThreadWithContactId, this will _NOT_ create a thread if one does not already exist.
+ (nullable instancetype)getThreadWithContactId:(NSString *)contactId transaction:(YapDatabaseReadTransaction *)transaction;
- (NSString *)contactIdentifier;
+ (NSString *)contactIdFromThreadId:(NSString *)threadId;
// This is only exposed for tests.
#ifdef DEBUG
+ (NSString *)threadIdFromContactId:(NSString *)contactId;
#endif
@end
NS_ASSUME_NONNULL_END