Don't throw on duplicate members in a group update

Fixes #364

// FREEBIE
This commit is contained in:
lilia 2015-10-01 20:57:19 -07:00
parent 1aee065c2c
commit 0fa1069a93
2 changed files with 2 additions and 2 deletions

View file

@ -38258,7 +38258,7 @@ axolotlInternal.RecipientRecord = function() {
var added = numbers.filter(function(number) { return group.numbers.indexOf(number) < 0; });
return textsecure.storage.groups.addNumbers(groupId, added).then(function(newGroup) {
if (newGroup.length != numbers.length ||
if (numbers.filter(function(number) { return newGroup.indexOf(number) < 0; }).length != 0 ||
newGroup.filter(function(number) { return numbers.indexOf(number) < 0; }).length != 0) {
throw new Error("Error calculating group member difference");
}

View file

@ -145,7 +145,7 @@
var added = numbers.filter(function(number) { return group.numbers.indexOf(number) < 0; });
return textsecure.storage.groups.addNumbers(groupId, added).then(function(newGroup) {
if (newGroup.length != numbers.length ||
if (numbers.filter(function(number) { return newGroup.indexOf(number) < 0; }).length != 0 ||
newGroup.filter(function(number) { return numbers.indexOf(number) < 0; }).length != 0) {
throw new Error("Error calculating group member difference");
}