Add nick to highlight notification from channels
This commit is contained in:
parent
24234be451
commit
c1c2297833
|
@ -815,16 +815,19 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
/* Function gets called from bufferLineAdded code if user should be notified */
|
/* Function gets called from bufferLineAdded code if user should be notified */
|
||||||
$rootScope.createHighlight = function(buffer, message) {
|
$rootScope.createHighlight = function(buffer, message) {
|
||||||
var title = '';
|
var title = '';
|
||||||
|
var body = '';
|
||||||
if (['#', '&', '+', '!'].indexOf(buffer.shortName.charAt(0)) < 0) {
|
if (['#', '&', '+', '!'].indexOf(buffer.shortName.charAt(0)) < 0) {
|
||||||
title = 'Private message from ';
|
title = 'Private message from ';
|
||||||
|
body = message.text;
|
||||||
} else {
|
} else {
|
||||||
title = 'Highlight in ';
|
title = 'Highlight in ';
|
||||||
|
body = '<' + message.prefix[0].text + '> ' + message.text;
|
||||||
}
|
}
|
||||||
title += buffer.shortName;
|
title += buffer.shortName;
|
||||||
title += buffer.fullName.replace(/irc.([^\.]+)\..+/, " ($1)");
|
title += buffer.fullName.replace(/irc.([^\.]+)\..+/, " ($1)");
|
||||||
|
|
||||||
var notification = new Notification(title, {
|
var notification = new Notification(title, {
|
||||||
body: message.text,
|
body: body,
|
||||||
icon: 'img/favicon.png'
|
icon: 'img/favicon.png'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue