From 55253125428f1cc72d86f833b7ffca265e2feb84 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 6 May 2021 15:59:53 +1000 Subject: [PATCH] syncConf every 7 days and fix link device --- js/background.js | 3 ++- preload.js | 1 + ts/session/utils/syncUtils.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/background.js b/js/background.js index 3631ae88f..5a8bb4606 100644 --- a/js/background.js +++ b/js/background.js @@ -756,8 +756,9 @@ messageReceiver.addEventListener('sent', window.DataMessageReceiver.handleMessageEvent); messageReceiver.addEventListener('reconnect', onReconnect); messageReceiver.addEventListener('configuration', onConfiguration); - // messageReceiver.addEventListener('typing', onTyping); + window.SwarmPolling.addPubkey(window.libsession.Utils.UserUtils.getOurPubKeyStrFromCache()); + window.SwarmPolling.start(); window.libsession.Utils.AttachmentDownloads.start({ logger: window.log, }); diff --git a/preload.js b/preload.js index ca15f6608..32cca1af0 100644 --- a/preload.js +++ b/preload.js @@ -328,6 +328,7 @@ window.LokiPublicChatAPI = require('./js/modules/loki_public_chat_api'); window.LokiFileServerAPI = require('./js/modules/loki_file_server_api'); window.LokiPushNotificationServerApi = require('./js/modules/loki_push_notification_server_api'); +window.SwarmPolling = require('./ts/session/snode_api/swarmPolling').SwarmPolling.getInstance(); const WorkerInterface = require('./js/modules/util_worker_interface'); diff --git a/ts/session/utils/syncUtils.ts b/ts/session/utils/syncUtils.ts index 144b36cd1..4bfbf7ec7 100644 --- a/ts/session/utils/syncUtils.ts +++ b/ts/session/utils/syncUtils.ts @@ -42,7 +42,7 @@ export const syncConfigurationIfNeeded = async () => { const now = Date.now(); // if the last sync was less than 2 days before, return early. - if (Math.abs(now - lastSyncedTimestamp) < DAYS * 2) { + if (Math.abs(now - lastSyncedTimestamp) < DAYS * 7) { return; }