mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 21:45:47 +01:00
Add more messaging hooks
This commit is contained in:
@@ -9,6 +9,7 @@ var emailer = require('../emailer');
|
||||
var notifications = require('../notifications');
|
||||
var meta = require('../meta');
|
||||
var sockets = require('../socket.io');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
module.exports = function (Messaging) {
|
||||
Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser
|
||||
@@ -27,6 +28,15 @@ module.exports = function (Messaging) {
|
||||
message: messageObj,
|
||||
};
|
||||
|
||||
plugins.fireHook('filter:messaging.notifyUsersInRoom', data, next);
|
||||
},
|
||||
function (data, next) {
|
||||
if (!data || !data.uids || !data.uids.length) {
|
||||
return next();
|
||||
}
|
||||
|
||||
var uids = data.uids;
|
||||
|
||||
uids.forEach(function (uid) {
|
||||
data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0;
|
||||
Messaging.pushUnreadCount(uid);
|
||||
|
||||
Reference in New Issue
Block a user