Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3389922
D6965.id23981.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6965.id23981.diff
View Options
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<string, string>();
+ 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--) {
@@ -379,7 +388,7 @@
continue;
}
- const originalMessageInfo =
+ let originalMessageInfo =
messageInfo.type === messageTypes.SIDEBAR_SOURCE
? messageInfo.sourceMessage
: messageInfo;
@@ -388,6 +397,16 @@
continue;
}
+ if (
+ originalMessageInfo.type === messageTypes.TEXT &&
+ originalMessageInfo.id
+ ) {
+ const newText = targetMessageEditMap.get(originalMessageInfo.id);
+ if (newText) {
+ originalMessageInfo = { ...originalMessageInfo, text: newText };
+ }
+ }
+
let startsConversation = true;
let startsCluster = true;
if (
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 9:07 PM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2602436
Default Alt Text
D6965.id23981.diff (1 KB)
Attached To
Mode
D6965: [lib][native] Displaying edited messages from database
Attached
Detach File
Event Timeline
Log In to Comment