diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 5533b7ce..fe8e65fb 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -37619,6 +37619,7 @@ var TextSecureServer = (function() { accounts : "v1/accounts", devices : "v1/devices", keys : "v2/keys", + signed : "v2/keys/signed", messages : "v1/messages", attachment : "v1/attachments" }; @@ -37776,6 +37777,17 @@ var TextSecureServer = (function() { jsonData : keys, }); }, + setSignedPreKey: function(signedPreKey) { + return this.ajax({ + call : 'signed', + httpType : 'PUT', + jsonData : { + keyId: signedPreKey.keyId, + publicKey: btoa(getString(signedPreKey.publicKey)), + signature: btoa(getString(signedPreKey.signature)) + } + }); + }, getMyKeys: function(number, deviceId) { return this.ajax({ call : 'keys', diff --git a/libtextsecure/api.js b/libtextsecure/api.js index 0ee01ed7..01634d7f 100644 --- a/libtextsecure/api.js +++ b/libtextsecure/api.js @@ -134,6 +134,7 @@ var TextSecureServer = (function() { accounts : "v1/accounts", devices : "v1/devices", keys : "v2/keys", + signed : "v2/keys/signed", messages : "v1/messages", attachment : "v1/attachments" }; @@ -291,6 +292,17 @@ var TextSecureServer = (function() { jsonData : keys, }); }, + setSignedPreKey: function(signedPreKey) { + return this.ajax({ + call : 'signed', + httpType : 'PUT', + jsonData : { + keyId: signedPreKey.keyId, + publicKey: btoa(getString(signedPreKey.publicKey)), + signature: btoa(getString(signedPreKey.signature)) + } + }); + }, getMyKeys: function(number, deviceId) { return this.ajax({ call : 'keys',