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:
parent
96eafc7750
commit
a960acacc6
3 changed files with 36 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue