Add textsecure.refreshKeys

This helper checks the server for the number of remaining prekeys, then
generates more if there are fewer than 10 remaining.

// FREEBIE
This commit is contained in:
lilia 2015-04-28 16:26:41 -07:00
parent 96eafc7750
commit a960acacc6
3 changed files with 36 additions and 0 deletions

View file

@ -248,6 +248,14 @@ textsecure.processDecrypted = function(decrypted, source) {
});
};
window.textsecure.refreshPreKeys = function() {
return textsecure.api.getMyKeys().then(function(preKeyCount) {
if (preKeyCount < 10) {
generateKeys();
}
});
};
function createAccount(number, verificationCode, identityKeyPair, single_device) {
textsecure.storage.put('identityKey', identityKeyPair);