Add notification count to notifications

This commit is contained in:
Lorenz Hübschle-Schneider 2014-03-13 20:33:46 +00:00
parent 24a7fe2d42
commit 54bb156f01

View file

@ -929,11 +929,21 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.createHighlight = function(buffer, message) {
var title = '';
var body = '';
var numNotifications = buffer.notification;
if (['#', '&', '+', '!'].indexOf(buffer.shortName.charAt(0)) < 0) {
if (numNotifications > 1) {
title = numNotifications.toString() + ' private messages from ';
} else {
title = 'Private message from ';
}
body = message.text;
} else {
if (numNotifications > 1) {
title = numNotifications.toString() + ' highlights in ';
} else {
title = 'Highlight in ';
}
var prefix = '';
for (var i = 0; i < message.prefix.length; i++) {
prefix += message.prefix[i].text;