Fix group loop

All the group messages were being sent to the last recipient in the
list, due to the persistence of `var number` in later loops and async
calls. An easy mistake to make, when you use for instead of each.
This commit is contained in:
lilia 2014-10-17 20:57:39 -07:00
parent 1571868520
commit cc5327dbc9

View file

@ -170,8 +170,7 @@ window.textsecure.messaging = function() {
});
}
for (var i = 0; i < numbers.length; i++) {
var number = numbers[i];
_.each(numbers, function(number) {
var devicesForNumber = textsecure.storage.devices.getDeviceObjectsForNumber(number);
var promises = [];
@ -191,7 +190,7 @@ window.textsecure.messaging = function() {
} else
doSendMessage(number, devicesForNumber, true);
});
}
});
}
makeAttachmentPointer = function(attachment) {