minor fix on conversation ordering
This commit is contained in:
parent
c85b9020b9
commit
f51651ce8e
|
@ -278,8 +278,18 @@ NSString *const TSLazyRestoreAttachmentsGroup = @"TSLazyRestoreAttachmentsGroup"
|
|||
TSThread *thread1 = (TSThread *)object1;
|
||||
TSThread *thread2 = (TSThread *)object2;
|
||||
if ([group isEqualToString:TSArchiveGroup] || [group isEqualToString:TSInboxGroup]) {
|
||||
NSDate *date1 = thread1.lastInteractionDate ?: thread1.creationDate;
|
||||
NSDate *date2 = thread2.lastInteractionDate ?: thread2.creationDate;
|
||||
|
||||
TSInteraction *_Nullable lastInteractionForInbox1 =
|
||||
[thread1 lastInteractionForInboxWithTransaction:transaction];
|
||||
NSDate *lastInteractionForInboxDate1 = lastInteractionForInbox1 ? lastInteractionForInbox1.receivedAtDate : thread1.creationDate;
|
||||
|
||||
TSInteraction *_Nullable lastInteractionForInbox2 =
|
||||
[thread2 lastInteractionForInboxWithTransaction:transaction];
|
||||
NSDate *lastInteractionForInboxDate2 = lastInteractionForInbox2 ? lastInteractionForInbox2.receivedAtDate : thread2.creationDate;
|
||||
|
||||
|
||||
NSDate *date1 = thread1.lastInteractionDate ?: lastInteractionForInboxDate1 ?: thread1.creationDate;
|
||||
NSDate *date2 = thread2.lastInteractionDate ?: lastInteractionForInboxDate2 ?: thread2.creationDate;
|
||||
return [date1 compare:date2];
|
||||
}
|
||||
|
||||
|
|
|
@ -357,7 +357,9 @@ BOOL IsNoteToSelfEnabled(void)
|
|||
return;
|
||||
}
|
||||
|
||||
_lastInteractionDate = lastMessage.receivedAtDate;
|
||||
if ([_lastInteractionDate compare: lastMessage.receivedAtDate] == NSOrderedAscending) {
|
||||
_lastInteractionDate = lastMessage.receivedAtDate;
|
||||
}
|
||||
|
||||
if (!self.shouldBeVisible) {
|
||||
self.shouldBeVisible = YES;
|
||||
|
|
Loading…
Reference in New Issue