|
|
@ -9,6 +9,7 @@ var emailer = require('../emailer');
|
|
|
|
var notifications = require('../notifications');
|
|
|
|
var notifications = require('../notifications');
|
|
|
|
var meta = require('../meta');
|
|
|
|
var meta = require('../meta');
|
|
|
|
var sockets = require('../socket.io');
|
|
|
|
var sockets = require('../socket.io');
|
|
|
|
|
|
|
|
var plugins = require('../plugins');
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = function (Messaging) {
|
|
|
|
module.exports = function (Messaging) {
|
|
|
|
Messaging.notifyQueue = {}; // Only used to notify a user of a new chat message, see Messaging.notifyUser
|
|
|
|
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,
|
|
|
|
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) {
|
|
|
|
uids.forEach(function (uid) {
|
|
|
|
data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0;
|
|
|
|
data.self = parseInt(uid, 10) === parseInt(fromUid, 10) ? 1 : 0;
|
|
|
|
Messaging.pushUnreadCount(uid);
|
|
|
|
Messaging.pushUnreadCount(uid);
|
|
|
|