revert libsignal-protocol and convert binary-encoded string to Uint8Array later down the line

pull/8/head
sachaaaaa 7 years ago
parent 54e238dee8
commit be29ea725a

File diff suppressed because it is too large Load Diff

@ -275,7 +275,11 @@ OutgoingMessage.prototype = {
);
}
ciphers[address.getDeviceId()] = sessionCipher;
return sessionCipher.encrypt(plaintext).then(ciphertext => ({
return sessionCipher.encrypt(plaintext).then(ciphertext => {
if (! this.fallBackEncryption)
ciphertext.body = new Uint8Array(dcodeIO.ByteBuffer.wrap(ciphertext.body,'binary').toArrayBuffer());
return ciphertext;
}).then(ciphertext => ({
type: ciphertext.type,
address: address,
destinationDeviceId: address.getDeviceId(),

Loading…
Cancel
Save