Fixes message clustering when there is an edit between

This commit is contained in:
Josh Perez 2023-06-30 10:04:19 -04:00 committed by GitHub
parent 45b4a7da56
commit 2930aa002a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,7 +125,8 @@ export function areMessagesInSameGroup(
return Boolean( return Boolean(
!olderMessage.reactions?.length && !olderMessage.reactions?.length &&
olderMessage.author.id === newerMessage.author.id && olderMessage.author.id === newerMessage.author.id &&
newerMessage.timestamp >= olderMessage.timestamp && (olderMessage.isEditedMessage ||
newerMessage.timestamp >= olderMessage.timestamp) &&
newerMessage.timestamp - olderMessage.timestamp < COLLAPSE_WITHIN && newerMessage.timestamp - olderMessage.timestamp < COLLAPSE_WITHIN &&
isSameDay(olderMessage.timestamp, newerMessage.timestamp) isSameDay(olderMessage.timestamp, newerMessage.timestamp)
); );