Printing out existing users

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-04 23:09:29 +02:00
parent 0cf6ff51fa
commit 5bb3731323

View File

@@ -87,7 +87,7 @@ module.exports = function() {
msg.hasOwnProperty("socket_id") && msg.hasOwnProperty("channel") && typeof(msg.guid) == "string" &&
typeof(msg.channel) == "string" && typeof(msg.socket_id) == "string" && msg.channel != "") {
db.collection("connected_users").find({"_id": msg.channel}, function(err, connected_users_channel) {
console.log("test: ", connected_users_channel.length > 0 && connected_users_channel[0].users.indexOf(msg.guid) > -1, connected_users_channel.length > 0, connected_users_channel[0].users.indexOf(msg.guid) > -1)
console.log("test: ", connected_users_channel.length > 0 && connected_users_channel[0].users.indexOf(msg.guid) > -1, connected_users_channel.length > 0, connected_users_channel[0].users.indexOf(msg.guid) > -1, connected_users_channel)
if(connected_users_channel.length > 0 && connected_users_channel[0].users.indexOf(msg.guid) > -1) {
socket.cookie_id = msg.guid;
guid = msg.guid;