mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add filter:notifications.create
This commit is contained in:
@@ -129,6 +129,12 @@ Notifications.create = async function (data) {
|
|||||||
}
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
data.datetime = now;
|
data.datetime = now;
|
||||||
|
const result = await plugins.hooks.fire('filter:notifications.create', {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
if (!result.data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.sortedSetAdd('notifications', now, data.nid),
|
db.sortedSetAdd('notifications', now, data.nid),
|
||||||
db.setObject(`notifications:${data.nid}`, data),
|
db.setObject(`notifications:${data.nid}`, data),
|
||||||
|
|||||||
Reference in New Issue
Block a user