@@ -36955,10 +36955,11 @@ MessageReceiver.prototype = {
|
|||||||
return this.handleAttachment(attachmentPointer).then(function() {
|
return this.handleAttachment(attachmentPointer).then(function() {
|
||||||
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
||||||
var groupDetails = groupBuffer.next();
|
var groupDetails = groupBuffer.next();
|
||||||
|
var promises = [];
|
||||||
while (groupDetails !== undefined) {
|
while (groupDetails !== undefined) {
|
||||||
(function(groupDetails) {
|
var promise = (function(groupDetails) {
|
||||||
groupDetails.id = getString(groupDetails.id);
|
groupDetails.id = getString(groupDetails.id);
|
||||||
textsecure.storage.groups.getGroup(groupDetails.id).
|
return textsecure.storage.groups.getGroup(groupDetails.id).
|
||||||
then(function(existingGroup) {
|
then(function(existingGroup) {
|
||||||
if (existingGroup === undefined) {
|
if (existingGroup === undefined) {
|
||||||
return textsecure.storage.groups.createNewGroup(
|
return textsecure.storage.groups.createNewGroup(
|
||||||
@@ -36976,7 +36977,11 @@ MessageReceiver.prototype = {
|
|||||||
});
|
});
|
||||||
})(groupDetails);
|
})(groupDetails);
|
||||||
groupDetails = groupBuffer.next();
|
groupDetails = groupBuffer.next();
|
||||||
|
promises.push(promise);
|
||||||
}
|
}
|
||||||
|
Promise.all(promises).then(function() {
|
||||||
|
eventTarget.dispatchEvent(new Event('groupsync'));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAttachment: function(attachment) {
|
handleAttachment: function(attachment) {
|
||||||
|
@@ -223,10 +223,11 @@ MessageReceiver.prototype = {
|
|||||||
return this.handleAttachment(attachmentPointer).then(function() {
|
return this.handleAttachment(attachmentPointer).then(function() {
|
||||||
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
var groupBuffer = new GroupBuffer(attachmentPointer.data);
|
||||||
var groupDetails = groupBuffer.next();
|
var groupDetails = groupBuffer.next();
|
||||||
|
var promises = [];
|
||||||
while (groupDetails !== undefined) {
|
while (groupDetails !== undefined) {
|
||||||
(function(groupDetails) {
|
var promise = (function(groupDetails) {
|
||||||
groupDetails.id = getString(groupDetails.id);
|
groupDetails.id = getString(groupDetails.id);
|
||||||
textsecure.storage.groups.getGroup(groupDetails.id).
|
return textsecure.storage.groups.getGroup(groupDetails.id).
|
||||||
then(function(existingGroup) {
|
then(function(existingGroup) {
|
||||||
if (existingGroup === undefined) {
|
if (existingGroup === undefined) {
|
||||||
return textsecure.storage.groups.createNewGroup(
|
return textsecure.storage.groups.createNewGroup(
|
||||||
@@ -244,7 +245,11 @@ MessageReceiver.prototype = {
|
|||||||
});
|
});
|
||||||
})(groupDetails);
|
})(groupDetails);
|
||||||
groupDetails = groupBuffer.next();
|
groupDetails = groupBuffer.next();
|
||||||
|
promises.push(promise);
|
||||||
}
|
}
|
||||||
|
Promise.all(promises).then(function() {
|
||||||
|
eventTarget.dispatchEvent(new Event('groupsync'));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAttachment: function(attachment) {
|
handleAttachment: function(attachment) {
|
||||||
|
Reference in New Issue
Block a user