No Backbone in data layer; server/client interfaces are now similar

This commit is contained in:
Scott Nonnenberg 2021-12-10 14:51:54 -08:00 committed by GitHub
parent 064bbfe97a
commit 34fd945f83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 573 additions and 1021 deletions

View file

@ -5,6 +5,7 @@
import { Collection, Model } from 'backbone';
import type { MessageModel } from '../models/messages';
import { getContactId } from '../messages/helpers';
import * as log from '../logging/log';
type DeleteAttributesType = {
@ -30,7 +31,7 @@ export class Deletes extends Collection<DeleteModel> {
const matchingDeletes = this.filter(item => {
return (
item.get('targetSentTimestamp') === message.get('sent_at') &&
item.get('fromId') === message.getContactId()
item.get('fromId') === getContactId(message.attributes)
);
});
@ -68,14 +69,11 @@ export class Deletes extends Collection<DeleteModel> {
log.info('Handling DOE for', del.get('targetSentTimestamp'));
const messages = await window.Signal.Data.getMessagesBySentAt(
del.get('targetSentTimestamp'),
{
MessageCollection: window.Whisper.MessageCollection,
}
del.get('targetSentTimestamp')
);
const targetMessage = messages.find(
m => del.get('fromId') === m.getContactId()
m => del.get('fromId') === getContactId(m)
);
if (!targetMessage) {