From dbb2bcb8f90f2197db3a2ed2c2d15d5017697ec1 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 23 Oct 2013 15:29:28 +0200 Subject: [PATCH] Fix notify level --- js/models.js | 4 ++-- js/websockets.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/models.js b/js/models.js index f10d9bf..ce8bbea 100644 --- a/js/models.js +++ b/js/models.js @@ -16,7 +16,7 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) { var number = message['number'] var pointer = message['pointers'][0] var local_variables = message['local_vars']; - var notify = 1; // Default 1 + var notify = 3 // Default 3 == message var lines = [] var active = false var notification = 0 @@ -24,7 +24,7 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) { var lastSeen = -2 // Buffer opened message does not include notify level - if( message['notify'] ) { + if( message['notify'] != undefined ) { notify = message['notify']; } diff --git a/js/websockets.js b/js/websockets.js index 9a65798..c29e9e5 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -43,13 +43,13 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'models', 'plugins', functi $rootScope.scrollToBottom(); } - if (!initial) { - if (!buffer.active && !buffer.notify==0 && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) { + if (!initial && !buffer.active) { + if (buffer.notify>1 && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) { buffer.unread++; $rootScope.$emit('notificationChanged'); } - if(!buffer.notify==0 && message.highlight || _.contains(message.tags, 'notify_private') ) { + if(buffer.notify!=0 && message.highlight || _.contains(message.tags, 'notify_private') ) { buffer.notification++; $rootScope.createHighlight(buffer, message); $rootScope.$emit('notificationChanged');