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
|
@ -10,6 +10,7 @@ import * as log from '../logging/log';
|
|||
import * as Errors from '../types/errors';
|
||||
import { deleteForEveryone } from '../util/deleteForEveryone';
|
||||
import { drop } from '../util/drop';
|
||||
import { getMessageSentTimestampSet } from '../util/getMessageSentTimestampSet';
|
||||
|
||||
export type DeleteAttributesType = {
|
||||
targetSentTimestamp: number;
|
||||
|
@ -31,10 +32,11 @@ export class Deletes extends Collection<DeleteModel> {
|
|||
}
|
||||
|
||||
forMessage(message: MessageModel): Array<DeleteModel> {
|
||||
const sentTimestamps = getMessageSentTimestampSet(message.attributes);
|
||||
const matchingDeletes = this.filter(item => {
|
||||
return (
|
||||
item.get('targetSentTimestamp') === message.get('sent_at') &&
|
||||
item.get('fromId') === getContactId(message.attributes)
|
||||
item.get('fromId') === getContactId(message.attributes) &&
|
||||
sentTimestamps.has(item.get('targetSentTimestamp'))
|
||||
);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue