diff --git a/install/package.json b/install/package.json index 836fbbc817..d5f5b0de8d 100644 --- a/install/package.json +++ b/install/package.json @@ -105,8 +105,8 @@ "nodebb-plugin-emoji-android": "4.0.0", "nodebb-plugin-markdown": "13.0.0-pre.9", "nodebb-plugin-mentions": "4.6.8", - "nodebb-plugin-ntfy": "1.7.7", "nodebb-plugin-spam-be-gone": "2.2.2", + "nodebb-plugin-web-push": "0.6.0", "nodebb-rewards-essentials": "1.0.0", "nodebb-theme-harmony": "2.0.0-pre.36", "nodebb-theme-lavender": "7.1.8", @@ -129,7 +129,7 @@ "rss": "1.2.2", "rtlcss": "4.3.0", "sanitize-html": "2.13.0", - "sass": "1.79.1", + "sass": "1.79.2", "semver": "7.6.3", "serve-favicon": "2.5.0", "sharp": "0.32.6", @@ -172,11 +172,11 @@ "mocha": "10.7.3", "mocha-lcov-reporter": "1.3.0", "mockdate": "3.0.5", - "nyc": "17.0.0", + "nyc": "17.1.0", "smtp-server": "3.13.5" }, "optionalDependencies": { - "sass-embedded": "1.79.1" + "sass-embedded": "1.79.2" }, "resolutions": { "*/jquery": "3.7.1" @@ -199,4 +199,4 @@ "url": "https://github.com/barisusakli" } ] -} \ No newline at end of file +} diff --git a/public/src/service-worker.js b/public/src/service-worker.js index 63cb1704e5..3f1c5e0bc5 100644 --- a/public/src/service-worker.js +++ b/public/src/service-worker.js @@ -43,8 +43,13 @@ self.addEventListener('push', function (event) { const { title, body, tag, data } = event.data.json(); if (title && body) { + const icon = data.icon; + delete data.icon; + const badge = data.badge; + delete data.badge; + event.waitUntil( - self.registration.showNotification(title, { body, tag, data }) + self.registration.showNotification(title, { body, tag, data, icon, badge }) ); } else if (tag) { event.waitUntil( diff --git a/src/install.js b/src/install.js index 53a6941c54..04c8ed569a 100644 --- a/src/install.js +++ b/src/install.js @@ -528,6 +528,7 @@ async function enableDefaultPlugins() { 'nodebb-plugin-composer-default', 'nodebb-plugin-markdown', 'nodebb-plugin-mentions', + 'nodebb-plugin-web-push', 'nodebb-widget-essentials', 'nodebb-rewards-essentials', 'nodebb-plugin-emoji', diff --git a/src/notifications.js b/src/notifications.js index ce4245fba7..1d020e536b 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -127,7 +127,7 @@ Notifications.findRelated = async function (mergeIds, set) { return []; } // A related notification is one in a zset that has the same mergeId - const nids = await db.getSortedSetRevRange(set, 0, -1); + const nids = await db.getSortedSetMembers(set); const keys = nids.map(nid => `notifications:${nid}`); const notificationData = await db.getObjectsFields(keys, ['mergeId']);