mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
feat: option in ACP to configure notification/email delay for chats
This commit is contained in:
@@ -4,12 +4,11 @@ var user = require('../user');
|
||||
var notifications = require('../notifications');
|
||||
var sockets = require('../socket.io');
|
||||
var plugins = require('../plugins');
|
||||
var meta = require('../meta');
|
||||
|
||||
module.exports = function (Messaging) {
|
||||
Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser
|
||||
|
||||
Messaging.notificationSendDelay = 1000 * 60;
|
||||
|
||||
Messaging.notifyUsersInRoom = async (fromUid, roomId, messageObj) => {
|
||||
let uids = await Messaging.getUidsInRoom(roomId, 0, -1);
|
||||
uids = await user.blocks.filterUids(fromUid, uids);
|
||||
@@ -48,7 +47,7 @@ module.exports = function (Messaging) {
|
||||
|
||||
queueObj.timeout = setTimeout(function () {
|
||||
sendNotifications(fromUid, uids, roomId, queueObj.message);
|
||||
}, Messaging.notificationSendDelay);
|
||||
}, (parseFloat(meta.config.notificationSendDelay) || 60) * 1000);
|
||||
};
|
||||
|
||||
async function sendNotifications(fromuid, uids, roomId, messageObj) {
|
||||
|
||||
Reference in New Issue
Block a user