mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
adding a check so that websocket method in notif pushing isn't called if the socket server isn't initialised
This commit is contained in:
@@ -197,8 +197,10 @@ var async = require('async'),
|
|||||||
plugins.fireHook('action:notification.pushed', {notification: notification, uids: uids});
|
plugins.fireHook('action:notification.pushed', {notification: notification, uids: uids});
|
||||||
|
|
||||||
var websockets = require('./socket.io');
|
var websockets = require('./socket.io');
|
||||||
for(var i=0; i<uids.length; ++i) {
|
if (websockets.server) {
|
||||||
websockets.in('uid_' + uids[i]).emit('event:new_notification', notification);
|
for(var i=0; i<uids.length; ++i) {
|
||||||
|
websockets.in('uid_' + uids[i]).emit('event:new_notification', notification);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
Reference in New Issue
Block a user