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',