rename hasEverHadMessage -> shouldThreadBeVisible

pull/1/head
Michael Kirk 6 years ago
parent 4ac93276c6
commit c0cb7df10a

@ -806,7 +806,7 @@ NS_ASSUME_NONNULL_BEGIN
if ([OWSProfileManager.sharedManager isThreadInProfileWhitelist:thread]) {
return NO;
}
if (!thread.hasEverHadMessage) {
if (!thread.shouldThreadBeVisible) {
[OWSProfileManager.sharedManager addThreadToProfileWhitelist:thread];
return YES;
} else {

@ -33,7 +33,7 @@ extern ConversationColorName const kConversationColorName_Default;
@interface TSThread : TSYapDatabaseObject
// YES IFF this thread has ever had a message.
@property (nonatomic) BOOL hasEverHadMessage;
@property (nonatomic) BOOL shouldThreadBeVisible;
/**
* Whether the object is a group thread or not.

@ -82,7 +82,16 @@ ConversationColorName const kConversationColorName_Default = ConversationColorNa
if (!self) {
return self;
}
// renamed `hasEverHadMessage` -> `shouldThreadBeVisible`
if (!_shouldThreadBeVisible) {
NSNumber *legacy_hasEverHadMessage = [coder decodeObjectForKey:@"hasEverHadMessage"];
if (legacy_hasEverHadMessage != nil) {
_shouldThreadBeVisible = legacy_hasEverHadMessage.boolValue;
}
}
if (_conversationColorName.length == 0) {
NSString *_Nullable colorSeed = self.contactIdentifier;
if (colorSeed.length > 0) {
@ -390,7 +399,7 @@ ConversationColorName const kConversationColorName_Default = ConversationColorNa
return;
}
self.hasEverHadMessage = YES;
self.shouldThreadBeVisible = YES;
NSDate *lastMessageDate = [lastMessage dateForSorting];
if (!_lastMessageDate || [lastMessageDate timeIntervalSinceDate:self.lastMessageDate] > 0) {

@ -204,7 +204,7 @@ public class FullTextSearchFinder: NSObject {
if let groupThread = object as? TSGroupThread {
return self.groupThreadIndexer.index(groupThread, transaction: transaction)
} else if let contactThread = object as? TSContactThread {
guard contactThread.hasEverHadMessage else {
guard contactThread.shouldThreadBeVisible else {
// If we've never sent/received a message in a TSContactThread,
// then we want it to appear in the "Other Contacts" section rather
// than in the "Conversations" section.

@ -204,7 +204,7 @@ NSString *const TSLazyRestoreAttachmentsGroup = @"TSLazyRestoreAttachmentsGroup"
if (thread.isGroupThread) {
// Do nothing; we never hide group threads.
} else if (thread.hasEverHadMessage) {
} else if (thread.shouldThreadBeVisible) {
// Do nothing; we never hide threads that have ever had a message.
} else {
YapDatabaseViewTransaction *viewTransaction = [transaction ext:TSMessageDatabaseViewExtensionName];

Loading…
Cancel
Save