mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-07-13 16:43:53 +01:00
Convert to array buffer
This commit is contained in:
+3
-1
@@ -33,7 +33,6 @@
|
||||
|
||||
if (thing instanceof Array) {
|
||||
// Assuming Uint16Array from curve25519
|
||||
//TODO: Move to convertToArrayBuffer
|
||||
var res = new ArrayBuffer(thing.length * 2);
|
||||
var uint = new Uint16Array(res);
|
||||
for (var i = 0; i < thing.length; i++)
|
||||
@@ -256,6 +255,9 @@
|
||||
putIdentityKey: function(identifier, publicKey) {
|
||||
if (identifier === null || identifier === undefined)
|
||||
throw new Error("Tried to put identity key for undefined/null key");
|
||||
if (!(publicKey instanceof ArrayBuffer)) {
|
||||
publicKey = convertToArrayBuffer(publicKey);
|
||||
}
|
||||
var number = textsecure.utils.unencodeNumber(identifier)[0];
|
||||
return new Promise(function(resolve) {
|
||||
var identityKey = new IdentityKey({id: number});
|
||||
|
||||
Reference in New Issue
Block a user