Move to centralized message/cache data layer
Also, ensure that conversation.messageCollection has nothing in it unless it has an associated ConversationView.
This commit is contained in:
parent
34231168a7
commit
f39a96bc76
21 changed files with 1119 additions and 993 deletions
|
@ -83,17 +83,19 @@
|
|||
|
||||
describe('Conversation', function() {
|
||||
var attributes = { type: 'private', id: '+18085555555' };
|
||||
before(function(done) {
|
||||
before(async () => {
|
||||
var convo = new Whisper.ConversationCollection().add(attributes);
|
||||
convo.save().then(function() {
|
||||
var message = convo.messageCollection.add({
|
||||
body: 'hello world',
|
||||
conversationId: convo.id,
|
||||
type: 'outgoing',
|
||||
sent_at: Date.now(),
|
||||
received_at: Date.now(),
|
||||
});
|
||||
message.save().then(done);
|
||||
await wrapDeferred(convo.save());
|
||||
|
||||
var message = convo.messageCollection.add({
|
||||
body: 'hello world',
|
||||
conversationId: convo.id,
|
||||
type: 'outgoing',
|
||||
sent_at: Date.now(),
|
||||
received_at: Date.now(),
|
||||
});
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
Message: Whisper.Message,
|
||||
});
|
||||
});
|
||||
after(clearDatabase);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue