diff --git a/src/Contacts/TSThread.m b/src/Contacts/TSThread.m index a056d098f..ccdfc564c 100644 --- a/src/Contacts/TSThread.m +++ b/src/Contacts/TSThread.m @@ -251,6 +251,19 @@ NS_ASSUME_NONNULL_BEGIN - (void)updateWithLastMessage:(TSInteraction *)lastMessage transaction:(YapDatabaseReadWriteTransaction *)transaction { NSDate *lastMessageDate = [lastMessage receiptDateForSorting]; + if ([lastMessage isKindOfClass:[TSErrorMessage class]]) { + TSErrorMessage *errorMessage = (TSErrorMessage *)lastMessage; + if (errorMessage.errorType == TSErrorMessageNonBlockingIdentityChange) { + // Otherwise all group threads with the recipient will percolate to the top of the inbox, even though + // there was no meaningful interaction. + DDLogDebug(@"%@ not updating lastMessage for thread:%@ nonblocking identity change: %@", + self.tag, + self, + errorMessage.debugDescription); + return; + } + } + if (!_lastMessageDate || [lastMessageDate timeIntervalSinceDate:self.lastMessageDate] > 0) { _lastMessageDate = lastMessageDate; diff --git a/src/Contacts/Threads/TSGroupThread.h b/src/Contacts/Threads/TSGroupThread.h index 39aa892b3..68a5a2004 100644 --- a/src/Contacts/Threads/TSGroupThread.h +++ b/src/Contacts/Threads/TSGroupThread.h @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN + (NSString *)threadIdFromGroupId:(NSData *)groupId; -// all group threads conrtaining recipient as a member +// all group threads containing recipient as a member + (NSArray *)groupThreadsWithRecipientId:(NSString *)recipientId; - (void)updateAvatarWithAttachmentStream:(TSAttachmentStream *)attachmentStream; diff --git a/src/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m b/src/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m index 5cc32417d..66b9bcf62 100644 --- a/src/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m +++ b/src/Storage/AxolotlStore/TSStorageManager+IdentityKeyStore.m @@ -84,8 +84,6 @@ - (void)createIdentityChangeInfoMessageForRecipientId:(NSString *)recipientId { - // TODO But should they be marked as dirty/play an alert? Probably not. - UInt64 nowTimestamp = [NSDate ows_millisecondTimeStamp]; TSContactThread *contactThread = [TSContactThread getOrCreateThreadWithContactId:recipientId];