Merge pull request #181 from tribut/notification-nick

Add nick to highlight notification from channels
This commit is contained in:
David Cormier 2014-02-24 10:19:42 -05:00
commit dcfc2284ea
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'
});