mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
feat: #9855, allow uid for post queue notifications
This commit is contained in:
@@ -2,5 +2,6 @@
|
|||||||
"notifications": "Notifications",
|
"notifications": "Notifications",
|
||||||
"welcome-notification": "Welcome Notification",
|
"welcome-notification": "Welcome Notification",
|
||||||
"welcome-notification-link": "Welcome Notification Link",
|
"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) {
|
async function sendQueueNotification(type, targetUid, path) {
|
||||||
const notifObj = await notifications.create({
|
const notifData = {
|
||||||
type: type,
|
type: type,
|
||||||
nid: `${type}-${targetUid}-${path}`,
|
nid: `${type}-${targetUid}-${path}`,
|
||||||
bodyShort: type === 'post-queue-accepted' ?
|
bodyShort: type === 'post-queue-accepted' ?
|
||||||
'[[notifications:post-queue-accepted]]' : '[[notifications:post-queue-rejected]]',
|
'[[notifications:post-queue-accepted]]' : '[[notifications:post-queue-rejected]]',
|
||||||
path: path,
|
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]);
|
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]]</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-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: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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user