mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
merged master
This commit is contained in:
@@ -61,7 +61,6 @@ websockets.init = function(io) {
|
||||
var hs = socket.handshake,
|
||||
sessionID, uid, lastPostTime = 0;
|
||||
|
||||
|
||||
// Validate the session, if present
|
||||
socketCookieParser(hs, {}, function(err) {
|
||||
sessionID = socket.handshake.signedCookies["express.sid"];
|
||||
@@ -104,8 +103,6 @@ websockets.init = function(io) {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
|
||||
var index = userSockets[uid].indexOf(socket);
|
||||
@@ -868,6 +865,12 @@ websockets.init = function(io) {
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('api:unread.count', function(callback) {
|
||||
topics.getUnreadTids(uid, 0, 19, function(err, tids) {
|
||||
socket.emit('event:unread.updateCount', tids.length);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('api:category.loadMore', function(data, callback) {
|
||||
var start = data.after,
|
||||
end = start + 9;
|
||||
@@ -1137,6 +1140,10 @@ websockets.init = function(io) {
|
||||
websockets.in = function(room) {
|
||||
return io.sockets.in(room);
|
||||
};
|
||||
|
||||
websockets.getConnectedClients = function() {
|
||||
return userSockets;
|
||||
}
|
||||
}
|
||||
})(module.exports);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user