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

@ -9,6 +9,7 @@ import { drop } from '../util/drop';
import { filter, size } from '../util/iterables';
import { getContactId } from '../messages/helpers';
import { handleEditMessage } from '../util/handleEditMessage';
import { getMessageSentTimestamp } from '../util/getMessageSentTimestamp';
export type EditAttributesType = {
conversationId: string;
@ -20,9 +21,10 @@ export type EditAttributesType = {
const edits = new Set<EditAttributesType>();
export function forMessage(message: MessageModel): Array<EditAttributesType> {
const sentAt = getMessageSentTimestamp(message.attributes, { log });
const matchingEdits = filter(edits, item => {
return (
item.targetSentTimestamp === message.get('sent_at') &&
item.targetSentTimestamp === sentAt &&
item.fromId === getContactId(message.attributes)
);
});