diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js --- a/lib/selectors/chat-selectors.js +++ b/lib/selectors/chat-selectors.js @@ -278,6 +278,7 @@ +robotext: EntityText, +threadCreatedFromMessage: ?ThreadInfo, +reactions: ReactionInfo, + +hasBeenEdited: boolean, }; export type ChatMessageInfoItem = | RobotextChatMessageInfoItem @@ -291,6 +292,7 @@ endsCluster: boolean, +threadCreatedFromMessage: ?ThreadInfo, +reactions: ReactionInfo, + +hasBeenEdited: boolean, }; export type ChatMessageItem = { itemType: 'loader' } | ChatMessageInfoItem; @@ -397,13 +399,18 @@ continue; } + let hasBeenEdited = false; if ( originalMessageInfo.type === messageTypes.TEXT && originalMessageInfo.id ) { const newText = targetMessageEditMap.get(originalMessageInfo.id); if (newText !== undefined) { - originalMessageInfo = { ...originalMessageInfo, text: newText }; + hasBeenEdited = true; + originalMessageInfo = { + ...originalMessageInfo, + text: newText, + }; } } @@ -489,6 +496,7 @@ endsCluster: false, threadCreatedFromMessage, reactions: renderedReactions, + hasBeenEdited, }); } else { invariant( @@ -511,6 +519,7 @@ threadCreatedFromMessage, robotext, reactions: renderedReactions, + hasBeenEdited, }); } lastMessageInfo = originalMessageInfo; diff --git a/native/chat/chat-item-height-measurer.react.js b/native/chat/chat-item-height-measurer.react.js --- a/native/chat/chat-item-height-measurer.react.js +++ b/native/chat/chat-item-height-measurer.react.js @@ -99,6 +99,7 @@ threadCreatedFromMessage: item.threadCreatedFromMessage, pendingUploads, reactions: item.reactions, + hasBeenEdited: item.hasBeenEdited, ...sizes, }; } @@ -124,6 +125,7 @@ threadCreatedFromMessage: item.threadCreatedFromMessage, contentHeight: height, reactions: item.reactions, + hasBeenEdited: item.hasBeenEdited, }; } invariant( @@ -148,6 +150,7 @@ robotext: item.robotext, contentHeight: height, reactions: item.reactions, + hasBeenEdited: item.hasBeenEdited, }; }, [composedMessageMaxWidth, inputStatePendingUploads, threadInfo], diff --git a/native/types/chat-types.js b/native/types/chat-types.js --- a/native/types/chat-types.js +++ b/native/types/chat-types.js @@ -24,6 +24,7 @@ +threadCreatedFromMessage: ?ThreadInfo, +contentHeight: number, +reactions: ReactionInfo, + +hasBeenEdited: boolean, }; export type ChatTextMessageInfoItemWithHeight = { @@ -38,6 +39,7 @@ +contentHeight: number, +threadCreatedFromMessage: ?ThreadInfo, +reactions: ReactionInfo, + +hasBeenEdited: boolean, }; export type MultimediaContentSizes = { @@ -58,6 +60,7 @@ +threadCreatedFromMessage: ?ThreadInfo, +pendingUploads: ?MessagePendingUploads, +reactions: ReactionInfo, + +hasBeenEdited: boolean, }; export type ChatMessageInfoItemWithHeight =