feat: #9855, allow uid for post queue notifications

isekai-main
Barış Soner Uşaklı 3 years ago
parent 4404e81991
commit 5aea6c6aa1

@ -2,5 +2,6 @@
"notifications": "Notifications",
"welcome-notification": "Welcome Notification",
"welcome-notification-link": "Welcome Notification Link",
"welcome-notification-uid": "Welcome Notification User (UID)"
"welcome-notification-uid": "Welcome Notification User (UID)",
"post-queue-notification-uid": "Post Queue User (UID)"
}

@ -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]);
}

@ -7,6 +7,7 @@
<strong>[[admin/settings/notifications:welcome-notification]]</strong><br /> <textarea class="form-control" data-field="welcomeNotification"></textarea><br />
<strong>[[admin/settings/notifications:welcome-notification-link]]</strong><br /> <input type="text" class="form-control" data-field="welcomeLink"><br />
<strong>[[admin/settings/notifications:welcome-notification-uid]]</strong><br /> <input type="text" class="form-control" data-field="welcomeUid"><br />
<strong>[[admin/settings/notifications:post-queue-notification-uid]]</strong><br /> <input type="text" class="form-control" data-field="postQueueNotificationUid"><br />
</form>
</div>
</div>

Loading…
Cancel
Save