mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
findOrCreateById instead of private-specific method
Anyway, findOrCreateById with no type didn't succeed, because the conversation didn't validate. FREEBIE
This commit is contained in:
@@ -86,24 +86,10 @@
|
||||
var conversation = conversations.add(attrs, {merge: true});
|
||||
return conversation;
|
||||
},
|
||||
findOrCreatePrivateById: function(id) {
|
||||
findOrCreateById: function(id, type) {
|
||||
var conversation = conversations.add({
|
||||
id: id,
|
||||
type: 'private'
|
||||
});
|
||||
return new Promise(function(resolve, reject) {
|
||||
conversation.fetch().then(function() {
|
||||
resolve(conversation);
|
||||
}, function() {
|
||||
conversation.save().then(function() {
|
||||
resolve(conversation);
|
||||
}, reject);
|
||||
});
|
||||
});
|
||||
},
|
||||
findOrCreateById: function(id) {
|
||||
var conversation = conversations.add({
|
||||
id: id
|
||||
type: type
|
||||
});
|
||||
return new Promise(function(resolve, reject) {
|
||||
conversation.fetch().then(function() {
|
||||
|
||||
Reference in New Issue
Block a user