Permalink
Browse files

Merge pull request #1037 from lorenzhs/fix-hotlist-sync

Disable periodic hotlist sync if read status sync is disabled
  • Loading branch information...
lorenzhs committed Nov 8, 2018
2 parents 934e853 + 352210d commit 358a0f7dcd44fefe1dc0a959bbaf9f720dae2bea
Showing with 15 additions and 12 deletions.
  1. +15 −12 js/connection.js
@@ -4,10 +4,11 @@
var weechat = angular.module('weechat');

weechat.factory('connection',
['$rootScope', '$log', 'handlers', 'models', 'ngWebsockets', function($rootScope,
['$rootScope', '$log', 'handlers', 'models', 'settings', 'ngWebsockets', function($rootScope,
$log,
handlers,
models,
settings,
ngWebsockets) {

var protocol = new weeChat.Protocol();
@@ -194,17 +195,19 @@ weechat.factory('connection',
handlers.handleHotlistInfo(hotlist);

});
// Schedule hotlist syncing every so often so that this
// client will have unread counts (mostly) in sync with
// other clients or terminal usage directly.
setInterval(function() {
if ($rootScope.connected) {
_requestHotlist().then(function(hotlist) {
handlers.handleHotlistInfo(hotlist);

});
}
}, 60000); // Sync hotlist every 60 second
if (settings.hotlistsync) {
// Schedule hotlist syncing every so often so that this
// client will have unread counts (mostly) in sync with
// other clients or terminal usage directly.
setInterval(function() {
if ($rootScope.connected) {
_requestHotlist().then(function(hotlist) {
handlers.handleHotlistInfo(hotlist);

});
}
}, 60000); // Sync hotlist every 60 second
}


// Fetch weechat time format for displaying timestamps

0 comments on commit 358a0f7

Please sign in to comment.