mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Update libsignal-protocol v1.1.4
// FREEBIE
This commit is contained in:
@@ -157,19 +157,16 @@ OutgoingMessage.prototype = {
|
||||
},
|
||||
|
||||
encryptToDevice: function(address, plaintext, sessionCipher) {
|
||||
return Promise.all([
|
||||
sessionCipher.encrypt(plaintext),
|
||||
sessionCipher.getRemoteRegistrationId()
|
||||
]).then(function(result) {
|
||||
return this.toJSON(address, result[0], result[1]);
|
||||
return sessionCipher.encrypt(plaintext).then(function(ciphertext) {
|
||||
return this.toJSON(address, ciphertext);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
toJSON: function(address, encryptedMsg, registrationId) {
|
||||
toJSON: function(address, encryptedMsg) {
|
||||
var json = {
|
||||
type: encryptedMsg.type,
|
||||
destinationDeviceId: address.getDeviceId(),
|
||||
destinationRegistrationId: registrationId
|
||||
type : encryptedMsg.type,
|
||||
destinationDeviceId : address.getDeviceId(),
|
||||
destinationRegistrationId : encryptedMsg.registrationId
|
||||
};
|
||||
|
||||
var content = btoa(encryptedMsg.body);
|
||||
|
||||
Reference in New Issue
Block a user