Sending list with also

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-04 23:48:40 +02:00
parent 82d8c0c300
commit 2b6aee218f
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 {
if(id == "empty" || id == undefined) {
callback();
@@ -264,6 +264,7 @@ function setChromecastHost(id, other_id, callback) {
return;
});
} catch(e) {
console.log(e);
callback(false);
}
}

View File

@@ -89,7 +89,13 @@ module.exports = function() {
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)
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);
});
socket.cookie_id = msg.guid;
@@ -99,13 +105,6 @@ module.exports = function() {
if(msg.hasOwnProperty("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;
console.log("chromecast list", coll);
chromecast_object = true;