Sending list with also

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-04 23:48:40 +02:00
parent 36618e34d4
commit a44869a3cd
2 changed files with 9 additions and 9 deletions

View File

@@ -253,7 +253,7 @@ function getSessionChatPass(id, callback) {
} }
function setChromecastHost(id, other_id, callback) { function setChromecastHost(id, other_id, list, callback) {
try { try {
if(id == "empty" || id == undefined) { if(id == "empty" || id == undefined) {
callback(); callback();
@@ -264,6 +264,7 @@ function setChromecastHost(id, other_id, callback) {
return; return;
}); });
} catch(e) { } catch(e) {
console.log(e);
callback(false); callback(false);
} }
} }

View File

@@ -89,7 +89,13 @@ module.exports = function() {
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) {
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) 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) { if(connected_users_channel.length > 0 && connected_users_channel[0].users.indexOf(msg.guid) > -1) {
Functions.setChromecastHost(socket.cookie_id, msg.guid, function(results) { coll = msg.channel.toLowerCase();//.replace(/ /g,'');
coll = Functions.removeEmojis(coll).toLowerCase();
coll = filter.clean(coll);
if(coll.indexOf("?") > -1){
coll = coll.substring(0, coll.indexOf("?"));
}
Functions.setChromecastHost(socket.cookie_id, msg.guid, msg.channel, function(results) {
console.log("setChromecastHost: ", results); console.log("setChromecastHost: ", results);
}); });
socket.cookie_id = msg.guid; socket.cookie_id = msg.guid;
@@ -99,13 +105,6 @@ module.exports = function() {
if(msg.hasOwnProperty("channel")) { if(msg.hasOwnProperty("channel")) {
msg.channel = Functions.encodeChannelName(msg.channel); msg.channel = Functions.encodeChannelName(msg.channel);
} }
coll = msg.channel.toLowerCase();//.replace(/ /g,'');
coll = Functions.removeEmojis(coll).toLowerCase();
coll = filter.clean(coll);
if(coll.indexOf("?") > -1){
coll = coll.substring(0, coll.indexOf("?"));
}
in_list = true; in_list = true;
console.log("chromecast list", coll); console.log("chromecast list", coll);
chromecast_object = true; chromecast_object = true;