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

@ -216,6 +216,16 @@ window.textsecure.api = function () {
});
};
self.getMyKeys = function(number, deviceId) {
return doAjax({
call : 'keys',
httpType : 'GET',
do_auth : true,
}).then(function(res) {
return parseInt(res.count);
});
};
self.getKeysForNumber = function(number, deviceId) {
if (deviceId === undefined)
deviceId = "*";