Show original sent timestamp for edited messages

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2024-07-15 18:14:13 -05:00 committed by GitHub
parent bc594b5ae7
commit 2179577636
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 9 deletions

View file

@ -4205,10 +4205,7 @@ export class ConversationModel extends window.Backbone
: undefined;
timestamp =
callHistory?.timestamp ||
activityMessage.get('editMessageTimestamp') ||
activityMessage.get('sent_at') ||
timestamp;
callHistory?.timestamp || activityMessage.get('sent_at') || timestamp;
lastMessageReceivedAt =
activityMessage.get('received_at') || lastMessageReceivedAt;
lastMessageReceivedAtMs =

View file

@ -775,7 +775,7 @@ export const getPropsForMessage = (
status: getMessagePropStatus(message, ourConversationId),
text: message.body,
textDirection: getTextDirection(message.body),
timestamp: getMessageSentTimestamp(message, { includeEdits: true, log }),
timestamp: getMessageSentTimestamp(message, { includeEdits: false, log }),
receivedAtMS: message.received_at_ms,
};
};

View file

@ -348,7 +348,7 @@ describe('editing', function (this: Mocha.Suite) {
await sendEditedMessage(
window,
firstEdit.dataMessage?.timestamp?.toNumber() ?? 0,
originalMessage.timestamp?.toNumber() ?? 0,
'.3'
);
@ -361,7 +361,7 @@ describe('editing', function (this: Mocha.Suite) {
debug('opening edit history');
const secondEditMessage = window.locator(
`.module-message[data-testid="${secondEdit.dataMessage?.timestamp?.toNumber()}"]`
`.module-message[data-testid="${originalMessage?.timestamp?.toNumber()}"]`
);
await secondEditMessage
.locator('.module-message__metadata__edited')
@ -669,7 +669,7 @@ describe('editing', function (this: Mocha.Suite) {
debug('sending edit message v3 desktop -> friend');
await sendEditedMessage(
page,
editMessageV2.dataMessage?.timestamp?.toNumber() ?? 0,
originalMessage?.timestamp?.toNumber() ?? 0,
'3'
);
@ -690,7 +690,7 @@ describe('editing', function (this: Mocha.Suite) {
debug('sending edit message v4 desktop -> friend');
await sendEditedMessage(
page,
editMessageV3.dataMessage?.timestamp?.toNumber() ?? 0,
originalMessage?.timestamp?.toNumber() ?? 0,
'4'
);