Add nick to highlight notification from channels

This commit is contained in:
Felix Eckhofer 2014-02-24 15:31:10 +01:00
parent 24234be451
commit c1c2297833
1 changed files with 4 additions and 1 deletions

View File

@ -815,16 +815,19 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
/* Function gets called from bufferLineAdded code if user should be notified */
$rootScope.createHighlight = function(buffer, message) {
var title = '';
var body = '';
if (['#', '&', '+', '!'].indexOf(buffer.shortName.charAt(0)) < 0) {
title = 'Private message from ';
body = message.text;
} else {
title = 'Highlight in ';
body = '<' + message.prefix[0].text + '> ' + message.text;
}
title += buffer.shortName;
title += buffer.fullName.replace(/irc.([^\.]+)\..+/, " ($1)");
var notification = new Notification(title, {
body: message.text,
body: body,
icon: 'img/favicon.png'
});