Regard the weechat buffer notify level

This commit is contained in:
Tor Hveem 2013-10-16 00:32:56 +02:00
parent 38db2afe0a
commit 830c486af0
2 changed files with 8 additions and 4 deletions

View file

@ -15,6 +15,8 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) {
var title = message['title'] var title = message['title']
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 notify = message['notify'];
var lines = [] var lines = []
var active = false var active = false
var notification = 0 var notification = 0
@ -42,6 +44,8 @@ models.service('models', ['$rootScope', 'colors', function($rootScope, colors) {
lastSeen: lastSeen, lastSeen: lastSeen,
unread: unread, unread: unread,
notification: notification, notification: notification,
localvars: local_variables,
notify: notify,
} }
} }

View file

@ -199,12 +199,12 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'models', 'plugins', functi
} }
if (!initial) { if (!initial) {
if (!buffer.active && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) { if (!buffer.active && !buffer.notify==0 && _.contains(message.tags, 'notify_message') && !_.contains(message.tags, 'notify_none')) {
buffer.unread++; buffer.unread++;
$rootScope.$emit('notificationChanged'); $rootScope.$emit('notificationChanged');
} }
if(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');
@ -320,8 +320,8 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
compression: 'off' compression: 'off'
})); }));
doSendWithCallback(WeeChatProtocol.formatHdata({ doSendWithCallback(WeeChatProtocol.formatHdata({
path: 'buffer:gui_buffers(*)', path: 'buffer:gui_buffers(*)',
keys: ['number,full_name,short_name,title'] keys: ['local_variables,notify,number,full_name,short_name,title']
})).then(function(message) { })).then(function(message) {
$log.info("Parsing bufinfo"); $log.info("Parsing bufinfo");
var bufferInfos = message['objects'][0]['content']; var bufferInfos = message['objects'][0]['content'];