mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 05:26:47 +02:00
feat: notification rescind support
This commit is contained in:
@@ -317,10 +317,13 @@ Notifications.pushGroups = async function (notification, groupNames) {
|
||||
|
||||
Notifications.rescind = async function (nids) {
|
||||
nids = Array.isArray(nids) ? nids : [nids];
|
||||
|
||||
await plugins.hooks.fire('static:notifications.rescind', { nids });
|
||||
await Promise.all([
|
||||
db.sortedSetRemove('notifications', nids),
|
||||
db.deleteAll(nids.map(nid => `notifications:${nid}`)),
|
||||
]);
|
||||
plugins.hooks.fire('action:notifications.rescind', { nids });
|
||||
};
|
||||
|
||||
Notifications.markRead = async function (nid, uid) {
|
||||
|
||||
Reference in New Issue
Block a user