Fix up a few things so registration works

This commit is contained in:
Matt Corallo 2014-03-23 13:19:53 -04:00
parent 832daf54db
commit 000a5e1440
4 changed files with 7 additions and 3 deletions

View file

@ -99,6 +99,11 @@ var API = new function() {
};
this.registerKeys = function(keys, success_callback, error_callback) {
//TODO: Do this conversion somewhere else?
var identityKey = btoa(getString(keys.keys[0].identityKey));
for (var i = 0; i < keys.keys.length; i++)
keys.keys[i] = {keyId: i, publicKey: btoa(getString(keys.keys[i].publicKey)), identityKey: identityKey};
keys.lastResortKey = {keyId: keys.lastResortKey.keyId, publicKey: btoa(getString(keys.lastResortKey.publicKey)), identityKey: identityKey};
this.doAjax({
call : 'keys',
httpType : 'PUT',

View file

@ -855,7 +855,7 @@ var crypto_tests = {};
if (identityKey === undefined)
crypto_storage.getNewPubKeySTORINGPrivKey("identityKey", function(pubKey) { identityKeyCalculated(pubKey); });
else
identityKeyCalculated(pubKey);
identityKeyCalculated(identityKey);
}
}( window.crypto = window.crypto || {}, jQuery ));

View file

@ -58,7 +58,7 @@ $('#init-go').click(function() {
$('#verify4done').html('');
$('#verify').show();
API.confirmCode(code, number, password, signaling_key, single_device,
API.confirmCode($('#code').val(), number, password, signaling_key, single_device,
function(response) {
if (single_device)
response = 1;

View file

@ -41,7 +41,6 @@
<script type="text/javascript" src="js-deps/ByteBuffer.min.js"></script>
<script type="text/javascript" src="js-deps/ProtoBuf.min.js"></script>
<script type="text/javascript" src="js/api.js"></script>
<script type="text/javascript" src="js/fake_api.js"></script>
<script type="text/javascript" src="js/helpers.js"></script>
<script type="text/javascript" src="js/options.js"></script>
</body>