File size: 838 Bytes
df72131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let io;

module.exports.initialize = function initialize(ioInstance) {
    io = ioInstance;
}
module.exports.collaborativeNotification = function collaborativeNotification(board,message) {
    const roomID1 = board.TeamID1.toString();
    io.to(roomID1).emit('notification',message);
    const roomID2 = board.TeamID2.toString();
    io.to(roomID2).emit('notification', message);
}
module.exports.teamNotification = function teamNotification(user,message) {
    const roomID = user.TeamID.toString();
    io.to(roomID).emit('notification',message);
}
module.exports.roomNotification = function roomNotification(user,message) {
    const roomID = user.RoomID.toString();
    io.to(roomID).emit('notification',message);
}
module.exports.userNotification = function userNotification(message) {
    io.sockets.emit('notification',message);
}