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

Disable periodic hotlist sync if read status sync is disabled
update-travis
Lorenz Hübschle-Schneider 7 years ago committed by GitHub
commit 358a0f7dcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      js/connection.js

@ -4,10 +4,11 @@
var weechat = angular.module('weechat'); var weechat = angular.module('weechat');
weechat.factory('connection', weechat.factory('connection',
['$rootScope', '$log', 'handlers', 'models', 'ngWebsockets', function($rootScope, ['$rootScope', '$log', 'handlers', 'models', 'settings', 'ngWebsockets', function($rootScope,
$log, $log,
handlers, handlers,
models, models,
settings,
ngWebsockets) { ngWebsockets) {
var protocol = new weeChat.Protocol(); var protocol = new weeChat.Protocol();
@ -194,17 +195,19 @@ weechat.factory('connection',
handlers.handleHotlistInfo(hotlist); handlers.handleHotlistInfo(hotlist);
}); });
// Schedule hotlist syncing every so often so that this if (settings.hotlistsync) {
// client will have unread counts (mostly) in sync with // Schedule hotlist syncing every so often so that this
// other clients or terminal usage directly. // client will have unread counts (mostly) in sync with
setInterval(function() { // other clients or terminal usage directly.
if ($rootScope.connected) { setInterval(function() {
_requestHotlist().then(function(hotlist) { if ($rootScope.connected) {
handlers.handleHotlistInfo(hotlist); _requestHotlist().then(function(hotlist) {
handlers.handleHotlistInfo(hotlist);
});
} });
}, 60000); // Sync hotlist every 60 second }
}, 60000); // Sync hotlist every 60 second
}
// Fetch weechat time format for displaying timestamps // Fetch weechat time format for displaying timestamps

Loading…
Cancel
Save