Refactor for less model duplication
This commit is contained in:
parent
c4eac76032
commit
baa55c9018
9 changed files with 71 additions and 50 deletions
|
@ -136,7 +136,7 @@
|
|||
if (dataMessage.group) {
|
||||
conversationId = dataMessage.group.id;
|
||||
}
|
||||
var conversation = new Whisper.Conversation({id: conversationId});
|
||||
var conversation = ConversationController.create({id: conversationId});
|
||||
conversation.fetch().always(function() {
|
||||
var now = new Date().getTime();
|
||||
var attributes = { type: 'private' };
|
||||
|
@ -218,6 +218,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
conversation.messageCollection.add(message);
|
||||
conversation.save().then(function() {
|
||||
message.save().then(function() {
|
||||
updateInbox();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue