Namespace global listeners to Whisper

This commit is contained in:
lilia 2017-04-12 13:31:50 -07:00
parent 3c2b7c8cbd
commit 510a5cb7fe
5 changed files with 9 additions and 7 deletions

View file

@ -86,9 +86,9 @@
openInbox();
}
WallClockListener.init();
RotateSignedPreKeyListener.init();
ExpiringMessagesListener.init();
Whisper.WallClockListener.init();
Whisper.RotateSignedPreKeyListener.init();
Whisper.ExpiringMessagesListener.init();
});
window.getSyncRequest = function() {

View file

@ -36,7 +36,7 @@
expiring.fetchNextExpiring();
}
window.ExpiringMessagesListener = {
Whisper.ExpiringMessagesListener = {
init: function() {
checkExpiringMessages();
window.events.on('timetravel', checkExpiringMessages);

View file

@ -481,7 +481,7 @@
var delta = this.get('expireTimer') * 1000;
var expires_at = start + delta;
this.save('expires_at', expires_at);
ExpiringMessagesListener.update();
Whisper.ExpiringMessagesListener.update();
console.log('message', this.get('sent_at'), 'expires at', expires_at);
}
}

View file

@ -4,6 +4,7 @@
;(function () {
'use strict';
window.Whisper = window.Whisper || {};
var ROTATION_INTERVAL = 48 * 60 * 60 * 1000;
var timeout;
@ -44,7 +45,7 @@
timeout = setTimeout(runWhenOnline, waitTime);
}
window.RotateSignedPreKeyListener = {
Whisper.RotateSignedPreKeyListener = {
init: function() {
if (Whisper.Registration.isDone()) {
setTimeoutForNextRun();

View file

@ -4,6 +4,7 @@
;(function () {
'use strict';
window.Whisper = window.Whisper || {};
var lastTime;
var interval = 1000;
@ -16,7 +17,7 @@
lastTime = currentTime;
}
window.WallClockListener = {
Whisper.WallClockListener = {
init: function() {
lastTime = Date.now();
setInterval(checkTime, 1000);