Use correct timestamp for receipts of edited messages
This commit is contained in:
parent
8fe0047822
commit
5869717cd3
21 changed files with 156 additions and 52 deletions
17
ts/util/getMessageSentTimestampSet.ts
Normal file
17
ts/util/getMessageSentTimestampSet.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { MessageAttributesType } from '../model-types.d';
|
||||
|
||||
export function getMessageSentTimestampSet({
|
||||
sent_at: sentAt,
|
||||
editHistory,
|
||||
}: Pick<
|
||||
MessageAttributesType,
|
||||
'sent_at' | 'editHistory'
|
||||
>): ReadonlySet<number> {
|
||||
return new Set([
|
||||
sentAt,
|
||||
...(editHistory?.map(({ timestamp }) => timestamp) ?? []),
|
||||
]);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue