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 @@ -367,6 +367,15 @@ } } + const targetMessageEditMap = new Map(); + for (let i = messages.length - 1; i >= 0; i--) { + const messageInfo = messages[i]; + if (messageInfo.type !== messageTypes.EDIT_MESSAGE) { + continue; + } + targetMessageEditMap.set(messageInfo.targetMessageID, messageInfo.text); + } + const chatMessageItems = []; let lastMessageInfo = null; for (let i = messages.length - 1; i >= 0; i--) { @@ -388,6 +397,13 @@ continue; } + if (messageInfo.type === messageTypes.TEXT && messageInfo.id) { + const newText = targetMessageEditMap.get(messageInfo.id); + if (newText !== undefined) { + messageInfo.text = newText; + } + } + let startsConversation = true; let startsCluster = true; if ( diff --git a/lib/types/messages/text.js b/lib/types/messages/text.js --- a/lib/types/messages/text.js +++ b/lib/types/messages/text.js @@ -28,5 +28,5 @@ +threadID: string, +creator: RelativeUserInfo, +time: number, // millisecond timestamp - +text: string, + text: string, };