1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Check if we need to upload new one-time keys every 10 minutes

This commit is contained in:
Mark Haines
2016-09-16 11:22:36 +01:00
parent 6e0b2de99f
commit da408f975e

View File

@@ -2497,6 +2497,11 @@ MatrixClient.prototype.startClient = function(opts) {
if (this._crypto) { if (this._crypto) {
this._crypto.uploadKeys(5).done(); this._crypto.uploadKeys(5).done();
var tenMinutes = 1000 * 60 * 10;
var self = this;
this._uploadIntervalID = global.setInterval(function() {
self._crypto.uploadKeys(5).done();
}, tenMinutes);
} }
// periodically poll for turn servers if we support voip // periodically poll for turn servers if we support voip
@@ -2522,6 +2527,9 @@ MatrixClient.prototype.stopClient = function() {
this._syncApi.stop(); this._syncApi.stop();
this._syncApi = null; this._syncApi = null;
} }
if (this._crypto) {
global.clearInterval(this._uploadIntervalID)
}
}; };
function setupCallEventHandler(client) { function setupCallEventHandler(client) {