@ -1146,8 +1146,6 @@ NS_ASSUME_NONNULL_BEGIN
TSGroupThread * newGroupThread =
[ TSGroupThread getOrCreateThreadWithGroupId : groupId transaction : transaction ] ;
uint64_t now = [ NSDate ows_millisecondTimeStamp ] ;
TSGroupModel * newGroupModel = [ [ TSGroupModel alloc ] initWithTitle : dataMessage . group . name
memberIds : newMemberIds . allObjects
image : oldGroupThread . groupModel . groupImage
@ -1157,23 +1155,19 @@ NS_ASSUME_NONNULL_BEGIN
newGroupThread . groupModel = newGroupModel ;
[ newGroupThread saveWithTransaction : transaction ] ;
/ / MJK FIXME - seems like we ' re relying on senderTimestamp
TSInfoMessage * infoMessage = [ [ TSInfoMessage alloc ] initWithSenderTimestamp : now
inThread : newGroupThread
messageType : TSInfoMessageTypeGroupUpdate
customMessage : updateGroupInfo ] ;
[ infoMessage saveWithTransaction : transaction ] ;
[ [ OWSDisappearingMessagesJob sharedJob ] becomeConsistentWithDisappearingDuration : dataMessage . expireTimer
thread : newGroupThread
createdByRemoteRecipientId : nil
createdInExistingGroup : NO
transaction : transaction ] ;
if ( dataMessage . hasExpireTimer && dataMessage . expireTimer > 0 ) {
/ / MJK - we can ' t rely on senderTimestamp
[ [ OWSDisappearingMessagesJob sharedJob ]
becomeConsistentWithDisappearingDuration : dataMessage . expireTimer
thread : newGroupThread
appearBeforeSenderTimestamp : now
createdByRemoteContactName : nil
createdInExistingGroup : YES
transaction : transaction ] ;
}
/ / MJK TODO - should be safe to remove senderTimestamp
TSInfoMessage * infoMessage =
[ [ TSInfoMessage alloc ] initWithSenderTimestamp : [ NSDate ows_millisecondTimeStamp ]
inThread : newGroupThread
messageType : TSInfoMessageTypeGroupUpdate
customMessage : updateGroupInfo ] ;
[ infoMessage saveWithTransaction : transaction ] ;
return nil ;
}
@ -1210,6 +1204,12 @@ NS_ASSUME_NONNULL_BEGIN
return nil ;
}
[ [ OWSDisappearingMessagesJob sharedJob ] becomeConsistentWithDisappearingDuration : dataMessage . expireTimer
thread : oldGroupThread
createdByRemoteRecipientId : envelope . source
createdInExistingGroup : YES
transaction : transaction ] ;
TSQuotedMessage * _Nullable quotedMessage = [ TSQuotedMessage quotedMessageForDataMessage : dataMessage
thread : oldGroupThread
transaction : transaction ] ;
@ -1255,6 +1255,12 @@ NS_ASSUME_NONNULL_BEGIN
TSContactThread * thread =
[ TSContactThread getOrCreateThreadWithContactId : envelope . source transaction : transaction ] ;
[ [ OWSDisappearingMessagesJob sharedJob ] becomeConsistentWithDisappearingDuration : dataMessage . expireTimer
thread : thread
createdByRemoteRecipientId : envelope . source
createdInExistingGroup : NO
transaction : transaction ] ;
TSQuotedMessage * _Nullable quotedMessage = [ TSQuotedMessage quotedMessageForDataMessage : dataMessage
thread : thread
transaction : transaction ] ;
@ -1369,10 +1375,6 @@ NS_ASSUME_NONNULL_BEGIN
[ OWSReadReceiptManager . sharedManager applyEarlyReadReceiptsForIncomingMessage : incomingMessage
transaction : transaction ] ;
[ [ OWSDisappearingMessagesJob sharedJob ] becomeConsistentWithConfigurationForMessage : incomingMessage
contactsManager : self . contactsManager
transaction : transaction ] ;
/ / Update thread preview in inbox
[ thread touchWithTransaction : transaction ] ;