Fix notify level

This commit is contained in:
Tor Hveem 2013-10-23 15:29:28 +02:00
parent a505c146f2
commit dbb2bcb8f9
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) {
var number = message['number'] var number = message['number']
var pointer = message['pointers'][0] var pointer = message['pointers'][0]
var local_variables = message['local_vars']; var local_variables = message['local_vars'];
var notify = 1; // Default 1 var notify = 3 // Default 3 == message
var lines = [] var lines = []
var active = false var active = false
var notification = 0 var notification = 0
@ -24,7 +24,7 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) {
var lastSeen = -2 var lastSeen = -2
// Buffer opened message does not include notify level // Buffer opened message does not include notify level
if( message['notify'] ) { if( message['notify'] != undefined ) {
notify = message['notify']; notify = message['notify'];
} }

View file

@ -43,13 +43,13 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'models', 'plugins', functi
$rootScope.scrollToBottom(); $rootScope.scrollToBottom();
} }
if (!initial) { if (!initial && !buffer.active) {
if (!buffer.active && !buffer.notify==0 && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) { if (buffer.notify>1 && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) {
buffer.unread++; buffer.unread++;
$rootScope.$emit('notificationChanged'); $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++; buffer.notification++;
$rootScope.createHighlight(buffer, message); $rootScope.createHighlight(buffer, message);
$rootScope.$emit('notificationChanged'); $rootScope.$emit('notificationChanged');