|
|
@ -1649,12 +1649,14 @@ typedef enum : NSUInteger {
|
|
|
|
if ([self.thread isKindOfClass:TSContactThread.class]) {
|
|
|
|
if ([self.thread isKindOfClass:TSContactThread.class]) {
|
|
|
|
NSString *senderID = ((TSContactThread *)self.thread).contactIdentifier;
|
|
|
|
NSString *senderID = ((TSContactThread *)self.thread).contactIdentifier;
|
|
|
|
__block NSSet<TSContactThread *> *linkedDeviceThreads;
|
|
|
|
__block NSSet<TSContactThread *> *linkedDeviceThreads;
|
|
|
|
|
|
|
|
__block BOOL isNoteToSelf;
|
|
|
|
[OWSPrimaryStorage.sharedManager.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
[OWSPrimaryStorage.sharedManager.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
linkedDeviceThreads = [LKDatabaseUtilities getLinkedDeviceThreadsFor:senderID in:transaction];
|
|
|
|
linkedDeviceThreads = [LKDatabaseUtilities getLinkedDeviceThreadsFor:senderID in:transaction];
|
|
|
|
|
|
|
|
isNoteToSelf = [LKDatabaseUtilities isUserLinkedDevice:senderID in:transaction];
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
if ([linkedDeviceThreads contains:^BOOL(TSContactThread *thread) {
|
|
|
|
if ([linkedDeviceThreads contains:^BOOL(TSContactThread *thread) {
|
|
|
|
return thread.isContactFriend;
|
|
|
|
return thread.isContactFriend;
|
|
|
|
}]) {
|
|
|
|
}] || isNoteToSelf) {
|
|
|
|
isEnabled = true;
|
|
|
|
isEnabled = true;
|
|
|
|
isAttachmentButtonHidden = false;
|
|
|
|
isAttachmentButtonHidden = false;
|
|
|
|
} else if (![linkedDeviceThreads contains:^BOOL(TSContactThread *thread) {
|
|
|
|
} else if (![linkedDeviceThreads contains:^BOOL(TSContactThread *thread) {
|
|
|
|