mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Chromecast backendfix
This commit is contained in:
@@ -42,7 +42,7 @@ module.exports = function() {
|
|||||||
try {
|
try {
|
||||||
if(typeof(msg) == "object" && msg.hasOwnProperty("guid") && msg.hasOwnProperty("socket_id") && msg.hasOwnProperty("channel")) {
|
if(typeof(msg) == "object" && msg.hasOwnProperty("guid") && msg.hasOwnProperty("socket_id") && msg.hasOwnProperty("channel")) {
|
||||||
db.collection("connected_users").find({"_id": msg.channel}, function(err, connected_users_channel) {
|
db.collection("connected_users").find({"_id": msg.channel}, function(err, connected_users_channel) {
|
||||||
if(connected_users_channel.users.indexOf(msg.guid) > -1) {
|
if(connected_users_channel.length > 0 && connected_users_channel[0].users.indexOf(msg.guid) > -1) {
|
||||||
guid = msg.guid;
|
guid = msg.guid;
|
||||||
socketid = msg.socket_id;
|
socketid = msg.socket_id;
|
||||||
socket.zoff_id = socketid;
|
socket.zoff_id = socketid;
|
||||||
@@ -51,7 +51,7 @@ module.exports = function() {
|
|||||||
chromecast_object = true;
|
chromecast_object = true;
|
||||||
socket.join(coll);
|
socket.join(coll);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user