From f4257c35c3348c5e87bff3e69f9bf0d65e0f8950 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sat, 30 Jul 2016 14:08:06 +0200 Subject: [PATCH] handlers: check for active buffer Check for active buffer before syncing unreads from WeeChat --- js/handlers.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/handlers.js b/js/handlers.js index 38196ad..2fd552e 100644 --- a/js/handlers.js +++ b/js/handlers.js @@ -306,7 +306,7 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific var handleBufferTypeChanged = function(message) { var obj = message.objects[0].content[0]; var buffer = obj.pointers[0]; - var old = models.getBuffer(buffer); + //var old = models.getBuffer(buffer); // 0 = formatted (normal); 1 = free buffer.bufferType = obj.type; }; @@ -350,6 +350,12 @@ weechat.factory('handlers', ['$rootScope', '$log', 'models', 'plugins', 'notific var hotlist = message.objects[0].content; hotlist.forEach(function(l) { var buffer = models.getBuffer(l.buffer); + // If buffer is active in gb, but not active in WeeChat the + // hotlist in WeeChat will increase but we should ignore that + // in gb. + if (buffer.active) { + return; + } // 1 is message buffer.unread = l.count[1]; // 2 is private