|
|
@ -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),
|
|
|
|