parent
6a268f0325
commit
d8381cfc47
2 changed files with 44 additions and 34 deletions
|
@ -36955,10 +36955,11 @@ MessageReceiver.prototype = {
|
|||
return this.handleAttachment(attachmentPointer).then(function() {
|
||||
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
||||
var groupDetails = groupBuffer.next();
|
||||
var promises = [];
|
||||
while (groupDetails !== undefined) {
|
||||
(function(groupDetails) {
|
||||
var promise = (function(groupDetails) {
|
||||
groupDetails.id = getString(groupDetails.id);
|
||||
textsecure.storage.groups.getGroup(groupDetails.id).
|
||||
return textsecure.storage.groups.getGroup(groupDetails.id).
|
||||
then(function(existingGroup) {
|
||||
if (existingGroup === undefined) {
|
||||
return textsecure.storage.groups.createNewGroup(
|
||||
|
@ -36976,7 +36977,11 @@ MessageReceiver.prototype = {
|
|||
});
|
||||
})(groupDetails);
|
||||
groupDetails = groupBuffer.next();
|
||||
promises.push(promise);
|
||||
}
|
||||
Promise.all(promises).then(function() {
|
||||
eventTarget.dispatchEvent(new Event('groupsync'));
|
||||
});
|
||||
});
|
||||
},
|
||||
handleAttachment: function(attachment) {
|
||||
|
|
|
@ -223,10 +223,11 @@ MessageReceiver.prototype = {
|
|||
return this.handleAttachment(attachmentPointer).then(function() {
|
||||
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
||||
var groupDetails = groupBuffer.next();
|
||||
var promises = [];
|
||||
while (groupDetails !== undefined) {
|
||||
(function(groupDetails) {
|
||||
var promise = (function(groupDetails) {
|
||||
groupDetails.id = getString(groupDetails.id);
|
||||
textsecure.storage.groups.getGroup(groupDetails.id).
|
||||
return textsecure.storage.groups.getGroup(groupDetails.id).
|
||||
then(function(existingGroup) {
|
||||
if (existingGroup === undefined) {
|
||||
return textsecure.storage.groups.createNewGroup(
|
||||
|
@ -244,7 +245,11 @@ MessageReceiver.prototype = {
|
|||
});
|
||||
})(groupDetails);
|
||||
groupDetails = groupBuffer.next();
|
||||
promises.push(promise);
|
||||
}
|
||||
Promise.all(promises).then(function() {
|
||||
eventTarget.dispatchEvent(new Event('groupsync'));
|
||||
});
|
||||
});
|
||||
},
|
||||
handleAttachment: function(attachment) {
|
||||
|
|
Loading…
Reference in a new issue