Use correct timestamp for receipts of edited messages

This commit is contained in:
Fedor Indutny 2023-05-16 10:37:12 -07:00 committed by GitHub
parent 8fe0047822
commit 5869717cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 156 additions and 52 deletions

View file

@ -48,6 +48,7 @@ import type {
import { SendMessageProtoError } from '../textsecure/Errors';
import * as expirationTimer from '../util/expirationTimer';
import { getUserLanguages } from '../util/userLanguages';
import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp';
import type { ReactionType } from '../types/Reactions';
import { UUID, UUIDKind } from '../types/UUID';
@ -1802,9 +1803,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
);
const isEditedMessage = Boolean(this.get('editHistory'));
const mainMessageTimestamp = this.get('sent_at') || this.get('timestamp');
const timestamp =
this.get('editMessageTimestamp') || mainMessageTimestamp;
const timestamp = getMessageSentTimestamp(this.attributes, { log });
const encodedContent = isEditedMessage
? {