Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions fishroom/web/chat_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ <h3><i class="glyphicon glyphicon-refresh"></i> Loading ...</h3>
msg.id = fishLogData.current_id;
fishLogData.current_id++;
fishLogData.msgs.push(msg);
// Notification sending...
var notification_title = 'New message from ' + msg.sender;
if ('Notification' in window) {
if (Notification.permission === 'granted') {
var notification = new Notification(notification_title);
}

else if (Notification.permission !== 'denied') {
Notification.requestPermission(function (permission) {
if (permission === 'granted') {
var notification = new Notification(notification_title);
}
});
}
}
}

var fetchLog = function(limit, lastId, scrollDown) {
Expand Down