Add signed key rotation scheduler

Rotate signed prekey every 48hrs, waiting for online access if
necessary. After a rotation attempt is made, schedule the next run for
48hrs in the future.

We use a timeout to "wake up" and handle the rotation. This timeout gets
set on startup and whenever the next rotation time is changed. For
paranoia's sake, always clear the current timeout before setting the
next one.

Since new registrations necessarily upload new signed keys, we reset the
scheduled time to T+48hrs on `registration_done` events.

// FREEBIE
This commit is contained in:
lilia 2017-02-16 11:59:32 -08:00
parent b92dd45a22
commit 536dd7b951
3 changed files with 61 additions and 0 deletions

View file

@ -84,6 +84,8 @@
if (open) {
openInbox();
}
RotateSignedPreKeyListener.init();
});
window.getSyncRequest = function() {