Enable browser notifications for messaging tools

This commit is contained in:
yflory
2018-10-02 12:08:25 +02:00
parent 1201f2dcc4
commit c5c6dc8223
5 changed files with 38 additions and 13 deletions

View File

@@ -549,6 +549,11 @@ define([
var el_message = markup.message(message);
common.notify();
if (message.type === 'MSG') {
var name = typeof message.name !== "undefined" ? (message.name || Messages.anonymous)
: contactsData[message.author].displayName;
common.notify({title: name, msg: message.text});
}
notifyToolbar();
channel.messages.push(message);
@@ -578,7 +583,7 @@ define([
}
var lastMsg = channel.messages.slice(-1)[0];
if (lastMsg.sig !== channel.HEAD) {
return void notify(chanId);
return void notify(chanId, message);
}
unnotify(chanId);
});