Remove tempKeys

Now that we simply establish and save a session via SessionBuilder
rather than saving the keys to pass in during encrypt, we can stop
caching them in memory in between the identity key check and the
encryption step.

// FREEBIE
This commit is contained in:
lilia 2016-04-27 15:47:24 -07:00
parent e2dbd90533
commit 78cdc0cb52
3 changed files with 22 additions and 70 deletions

View file

@ -131,10 +131,7 @@ OutgoingMessage.prototype = {
var plaintext = this.message.toArrayBuffer();
return Promise.all(deviceObjectList.map(function(device) {
return textsecure.protocol_wrapper.encryptMessageFor(device, plaintext).then(function(encryptedMsg) {
var json = this.toJSON(device, encryptedMsg);
return textsecure.storage.devices.removeTempKeysFromDevice(device.encodedNumber).then(function() {
return json;
});
return this.toJSON(device, encryptedMsg);
}.bind(this));
}.bind(this)));
},