From 40cab75f9679853f4a36907f67db7e27872b3b3d Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Wed, 16 Jun 2021 16:19:40 +0200 Subject: [PATCH] Add avatar as notifications icon --- src/frontend/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/frontend/index.js b/src/frontend/index.js index 3e2d336..37a4354 100644 --- a/src/frontend/index.js +++ b/src/frontend/index.js @@ -604,8 +604,10 @@ function onMsgOrFileReceived(sessionId, outgoing, body) { } if (document.hidden && !outgoing) { if (notificationAllowed) { - new Notification(sessionsData.get(sessionId).name, { - "body": body + let sessionName = sessionsData.get(sessionId).name; + new Notification(sessionName, { + "body": body, + "icon": "/avatar/"+sessionId+"/"+sessionName+"?"+avatarTimestamps.get(sessionId) }); } } @@ -698,7 +700,8 @@ function onAskLargeFiles(sessionId, encodedDownloadLocation, filesInfo) { showPopup(mainDiv, false); if (document.hidden && notificationAllowed) { new Notification(sessionName, { - "body": "Files download request" + "body": "Files download request", + "icon": "/avatar/"+sessionId+"/"+sessionName+"?"+avatarTimestamps.get(sessionId) }); } }