Move tryMessageAgain to MessageReceiver

`tryMessageAgain` is the routine called when re-trying a message that
failed to decrypt due to an IncomingIdentityKeyError. This handling
needs to move to MessageReceiver because it depends on
`processDecrypted` to handle incoming message protos, which depends
on a server instance in order to download attachments.

// FREEBIE
This commit is contained in:
lilia 2015-09-25 17:25:25 -07:00
parent 0fc673f25f
commit bc03bdbfc4
4 changed files with 102 additions and 102 deletions

View file

@ -101,7 +101,7 @@ MessageSender.prototype = {
}
};
function getKeysForNumber(number, updateDevices) {
var getKeysForNumber = function(number, updateDevices) {
var handleResult = function(response) {
return Promise.all(response.devices.map(function(device) {
if (updateDevices === undefined || updateDevices.indexOf(device.deviceId) > -1)
@ -133,7 +133,7 @@ MessageSender.prototype = {
return Promise.all(promises);
}
}
}.bind(this);
var doSendMessage = function(number, devicesForNumber, recurse) {
return this.sendMessageToDevices(timestamp, number, devicesForNumber, message).then(function(result) {