feat: #9855, allow uid for post queue notifications

This commit is contained in:
Barış Soner Uşaklı
2021-10-03 15:05:30 -04:00
parent 4404e81991
commit 5aea6c6aa1
3 changed files with 9 additions and 3 deletions

View File

@@ -150,13 +150,17 @@ async function acceptOrReject(method, socket, data) {
}
async function sendQueueNotification(type, targetUid, path) {
const notifObj = await notifications.create({
const notifData = {
type: type,
nid: `${type}-${targetUid}-${path}`,
bodyShort: type === 'post-queue-accepted' ?
'[[notifications:post-queue-accepted]]' : '[[notifications:post-queue-rejected]]',
path: path,
});
};
if (parseInt(meta.config.postQueueNotificationUid, 10) > 0) {
notifData.from = meta.config.postQueueNotificationUid;
}
const notifObj = await notifications.create(notifData);
await notifications.push(notifObj, [targetUid]);
}