feat: add filter:notifications.create

v1.18.x
Barış Soner Uşaklı 4 years ago
parent f9b248b87f
commit ac7b093f99

@ -129,6 +129,12 @@ Notifications.create = async function (data) {
}
const now = Date.now();
data.datetime = now;
const result = await plugins.hooks.fire('filter:notifications.create', {
data: data,
});
if (!result.data) {
return;
}
await Promise.all([
db.sortedSetAdd('notifications', now, data.nid),
db.setObject(`notifications:${data.nid}`, data),

Loading…
Cancel
Save