Add avatar as notifications icon

This commit is contained in:
Matéo Duparc 2021-06-16 16:19:40 +02:00
parent 03a9df81ec
commit 40cab75f96
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E

View File

@ -604,8 +604,10 @@ function onMsgOrFileReceived(sessionId, outgoing, body) {
} }
if (document.hidden && !outgoing) { if (document.hidden && !outgoing) {
if (notificationAllowed) { if (notificationAllowed) {
new Notification(sessionsData.get(sessionId).name, { let sessionName = sessionsData.get(sessionId).name;
"body": body new Notification(sessionName, {
"body": body,
"icon": "/avatar/"+sessionId+"/"+sessionName+"?"+avatarTimestamps.get(sessionId)
}); });
} }
} }
@ -698,7 +700,8 @@ function onAskLargeFiles(sessionId, encodedDownloadLocation, filesInfo) {
showPopup(mainDiv, false); showPopup(mainDiv, false);
if (document.hidden && notificationAllowed) { if (document.hidden && notificationAllowed) {
new Notification(sessionName, { new Notification(sessionName, {
"body": "Files download request" "body": "Files download request",
"icon": "/avatar/"+sessionId+"/"+sessionName+"?"+avatarTimestamps.get(sessionId)
}); });
} }
} }