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
|
@ -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 = "*";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue