mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed query-element in url issue
This commit is contained in:
@@ -34,7 +34,11 @@ module.exports = function() {
|
||||
socket.emit("guid", guid);
|
||||
|
||||
socket.on('self_ping', function(msg) {
|
||||
|
||||
var channel = msg.channel;
|
||||
if(channel.indexOf("?") > -1){
|
||||
channel = channel.substring(0, channel.indexOf("?"));
|
||||
}
|
||||
channel = channel.replace(/ /g,'');
|
||||
if(offline) {
|
||||
db.collection("connected_users").update({"_id": "offline_users"}, {$addToSet: {users: guid}}, {upsert: true}, function(err, docs){});
|
||||
@@ -66,6 +70,9 @@ module.exports = function() {
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
coll = filter.clean(coll);
|
||||
if(coll.indexOf("?") > -1){
|
||||
coll = coll.substring(0, coll.indexOf("?"));
|
||||
}
|
||||
in_list = true;
|
||||
chromecast_object = true;
|
||||
socket.join(coll);
|
||||
@@ -85,6 +92,10 @@ module.exports = function() {
|
||||
try {
|
||||
var _list = msg.channel.replace(/ /g,'');
|
||||
if(_list.length == 0) return;
|
||||
if(_list.indexOf("?") > -1){
|
||||
_list = _list.substring(0, _list.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
coll = emojiStrip(_list).toLowerCase();
|
||||
coll = coll.replace(/_/g, "");
|
||||
|
||||
@@ -110,18 +121,34 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on('suggest_thumbnail', function(msg){
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
Suggestions.thumbnail(msg, coll.replace(/ /g,''), guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('suggest_description', function(msg){
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
Suggestions.description(msg, coll.replace(/ /g,''), guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on("namechange", function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
Chat.namechange(msg, guid, socket);
|
||||
});
|
||||
|
||||
socket.on("removename", function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(typeof(msg) != "object" || !msg.hasOwnProperty("channel")) {
|
||||
var result = {
|
||||
channel: {
|
||||
@@ -136,6 +163,10 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on("offline", function(msg){
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(!msg.hasOwnProperty('status') || !msg.hasOwnProperty('channel') ||
|
||||
typeof(msg.status) != "boolean" || typeof(msg.channel) != "string") {
|
||||
var result = {
|
||||
@@ -195,6 +226,10 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on('get_history', function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(!msg.hasOwnProperty("channel") || !msg.hasOwnProperty("all") ||
|
||||
typeof(msg.channel) != "string" || typeof(msg.all) != "boolean") {
|
||||
var result = {
|
||||
@@ -218,20 +253,36 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on('chat', function (msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
Chat.chat(msg, guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on("all,chat", function(data)
|
||||
{
|
||||
if(data.hasOwnProperty("channel") && data.channel.indexOf("?") > -1){
|
||||
var _list = data.channel.substring(0, data.channel.indexOf("?"));
|
||||
data.channel = _list;
|
||||
}
|
||||
Chat.all_chat(data, guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('frontpage_lists', function(msg)
|
||||
{
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
Frontpage.frontpage_lists(msg, socket);
|
||||
});
|
||||
|
||||
socket.on('import_zoff', function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
ListChange.addFromOtherList(msg, guid, offline, socket);
|
||||
})
|
||||
|
||||
@@ -242,15 +293,27 @@ module.exports = function() {
|
||||
|
||||
socket.on('id', function(arr)
|
||||
{
|
||||
if(arr.hasOwnProperty("channel") && arr.channel.indexOf("?") > -1){
|
||||
var _list = arr.channel.substring(0, arr.channel.indexOf("?"));
|
||||
arr.channel = _list;
|
||||
}
|
||||
if(typeof(arr) == 'object')
|
||||
io.to(arr.id).emit(arr.id.toLowerCase(), {type: arr.type, value: arr.value});
|
||||
});
|
||||
|
||||
socket.on('list', function(msg)
|
||||
{
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
try {
|
||||
var _list = msg.channel.replace(/ /g,'');
|
||||
if(_list.length == 0) return;
|
||||
if(_list.indexOf("?") > -1){
|
||||
_list = _list.substring(0, _list.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
coll = emojiStrip(_list).toLowerCase();
|
||||
coll = coll.replace(/_/g, "");
|
||||
//
|
||||
@@ -258,6 +321,7 @@ module.exports = function() {
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(msg.hasOwnProperty("offline") && msg.offline) {
|
||||
offline = true;
|
||||
}
|
||||
@@ -267,6 +331,10 @@ module.exports = function() {
|
||||
|
||||
socket.on('end', function(obj)
|
||||
{
|
||||
if(obj.hasOwnProperty("channel") && obj.channel.indexOf("?") > -1){
|
||||
var _list = obj.channel.substring(0, obj.channel.indexOf("?"));
|
||||
obj.channel = _list;
|
||||
}
|
||||
if(coll === undefined) {
|
||||
try {
|
||||
coll = obj.channel.toLowerCase().replace(/ /g,'');
|
||||
@@ -283,11 +351,19 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on('addPlaylist', function(arr) {
|
||||
if(arr.hasOwnProperty("channel") && arr.channel.indexOf("?") > -1){
|
||||
var _list = arr.channel.substring(0, arr.channel.indexOf("?"));
|
||||
arr.channel = _list;
|
||||
}
|
||||
ListChange.addPlaylist(arr, guid, offline, socket);
|
||||
})
|
||||
|
||||
socket.on('add', function(arr)
|
||||
{
|
||||
if(arr.hasOwnProperty("channel") && arr.channel.indexOf("?") > -1){
|
||||
var _list = arr.channel.substring(0, arr.channel.indexOf("?"));
|
||||
arr.channel = _list;
|
||||
}
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
coll = arr.list.replace(/ /g,'');
|
||||
@@ -305,6 +381,10 @@ module.exports = function() {
|
||||
|
||||
socket.on('delete_all', function(msg) {
|
||||
try {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
if(coll.length == 0) return;
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
@@ -320,6 +400,10 @@ module.exports = function() {
|
||||
|
||||
socket.on('vote', function(msg)
|
||||
{
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
@@ -337,22 +421,38 @@ module.exports = function() {
|
||||
|
||||
socket.on('password', function(inp)
|
||||
{
|
||||
if(inp.hasOwnProperty("channel") && inp.channel.indexOf("?") > -1){
|
||||
var _list = inp.channel.substring(0, inp.channel.indexOf("?"));
|
||||
inp.channel = _list;
|
||||
}
|
||||
if(coll != undefined) coll.replace(/ /g,'');
|
||||
ListSettings.password(inp, coll, guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('skip', function(list)
|
||||
{
|
||||
if(list.hasOwnProperty("channel") && list.channel.indexOf("?") > -1){
|
||||
var _list = list.channel.substring(0, list.channel.indexOf("?"));
|
||||
list.channel = _list;
|
||||
}
|
||||
List.skip(list, guid, coll.replace(/ /g,''), offline, socket);
|
||||
});
|
||||
|
||||
socket.on('conf', function(params)
|
||||
{
|
||||
if(conf.hasOwnProperty("channel") && conf.channel.indexOf("?") > -1){
|
||||
var _list = conf.channel.substring(0, conf.channel.indexOf("?"));
|
||||
conf.channel = _list;
|
||||
}
|
||||
ListSettings.conf_function(params, coll.replace(/ /g,''), guid, offline, socket);
|
||||
});
|
||||
|
||||
socket.on('shuffle', function(msg)
|
||||
{
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
coll = msg.channel.toLowerCase().replace(/ /g,'');
|
||||
@@ -370,6 +470,10 @@ module.exports = function() {
|
||||
|
||||
socket.on('change_channel', function(obj)
|
||||
{
|
||||
if(obj.hasOwnProperty("channel") && obj.channel.indexOf("?") > -1){
|
||||
var _list = obj.channel.substring(0, obj.channel.indexOf("?"));
|
||||
obj.channel = _list;
|
||||
}
|
||||
if(coll === undefined && obj !== undefined && obj.channel !== undefined){
|
||||
try {
|
||||
coll = obj.channel.toLowerCase().replace(/ /g,'');
|
||||
@@ -397,6 +501,10 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
socket.on("left_channel", function(msg) {
|
||||
if(msg.hasOwnProperty("channel") && msg.channel.indexOf("?") > -1){
|
||||
var _list = msg.channel.substring(0, msg.channel.indexOf("?"));
|
||||
msg.channel = _list;
|
||||
}
|
||||
if(msg.hasOwnProperty("channel") && msg.channel != "" && typeof(msg.channel) == "string") {
|
||||
coll = msg.channel.replace(/ /g,'');
|
||||
coll = emojiStrip(coll).toLowerCase();
|
||||
@@ -422,6 +530,10 @@ module.exports = function() {
|
||||
|
||||
socket.on('pos', function(obj)
|
||||
{
|
||||
if(obj.hasOwnProperty("channel") && obj.channel.indexOf("?") > -1){
|
||||
var _list = obj.channel.substring(0, obj.channel.indexOf("?"));
|
||||
obj.channel = _list;
|
||||
}
|
||||
if(!obj.hasOwnProperty("channel") || typeof(obj.channel) != "string")
|
||||
if(coll !== undefined) {
|
||||
try {
|
||||
|
||||
@@ -429,6 +429,7 @@ function get_list_listener(){
|
||||
//if(private_channel) add = Crypt.getCookie("_uI") + "_";
|
||||
/*var p = Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()), true);
|
||||
if(p == undefined) p = "";*/
|
||||
chan= "jomedia?utm_medium=referral&utm_source=10khits.com&utm_campaign=394434: 1";
|
||||
socket.emit("list", { offline: offline, version: parseInt(localStorage.getItem("VERSION")), channel: add + chan.toLowerCase()});
|
||||
});
|
||||
socket.on("id_chromecast", function(msg) {
|
||||
|
||||
Reference in New Issue
Block a user