mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-08 20:48:48 +00:00
More indentation
This commit is contained in:
@@ -82,14 +82,12 @@ function decrypt_string(socket_id, pw){
|
|||||||
var decrypted = CryptoJS.enc.Utf8.stringify(
|
var decrypted = CryptoJS.enc.Utf8.stringify(
|
||||||
CryptoJS.AES.decrypt({
|
CryptoJS.AES.decrypt({
|
||||||
ciphertext: encrypted
|
ciphertext: encrypted
|
||||||
},
|
}, key, {
|
||||||
key,
|
|
||||||
// edit: changed to Pkcs5
|
|
||||||
{
|
|
||||||
mode: CryptoJS.mode.CBC,
|
mode: CryptoJS.mode.CBC,
|
||||||
padding: CryptoJS.pad.Pkcs7,
|
padding: CryptoJS.pad.Pkcs7,
|
||||||
iv: iv,
|
iv: iv,
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
return decrypted;
|
return decrypted;
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -33,13 +33,7 @@ module.exports = function() {
|
|||||||
db.collection("frontpage_lists").update({"_id": channel}, {$inc: {viewers: 1}}, {upsert: true}, function(){});
|
db.collection("frontpage_lists").update({"_id": channel}, {$inc: {viewers: 1}}, {upsert: true}, function(){});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/*if(name != "") {
|
|
||||||
db.collection("user_names").update({"_id": "all_names"}, {$addToSet: {names: name}}, {upsert: true}, function(err, updated) {
|
|
||||||
if(updated.nModified == 1) {
|
|
||||||
db.collection("user_names").update({"guid": guid}, {$set: {name: name}}, {upsert:true}, function(err, update){});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
db.collection("connected_users").update({"_id": "total_users"}, {$inc: {total_users: 1}}, {upsert: true}, function(err, docs){});
|
db.collection("connected_users").update({"_id": "total_users"}, {$inc: {total_users: 1}}, {upsert: true}, function(err, docs){});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -122,22 +116,6 @@ module.exports = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*socket.on('namechange', function(msg)
|
|
||||||
{
|
|
||||||
if(coll == undefined) {
|
|
||||||
coll = msg.channel;
|
|
||||||
}
|
|
||||||
Chat.namechange(msg.name, guid, coll, function(new_name) {
|
|
||||||
name = new_name;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('removename', function()
|
|
||||||
{
|
|
||||||
Chat.removename(guid, coll);
|
|
||||||
name = "";
|
|
||||||
});*/
|
|
||||||
|
|
||||||
socket.on('chat', function (msg) {
|
socket.on('chat', function (msg) {
|
||||||
Chat.chat(msg, guid, offline, socket);
|
Chat.chat(msg, guid, offline, socket);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -68,9 +68,9 @@ var Chat = {
|
|||||||
}
|
}
|
||||||
data.value = "";
|
data.value = "";
|
||||||
return;
|
return;
|
||||||
},
|
},
|
||||||
|
|
||||||
allchat: function(inp) {
|
allchat: function(inp) {
|
||||||
if(inp.msg.substring(0,1) == ":" && !chat_active) {
|
if(inp.msg.substring(0,1) == ":" && !chat_active) {
|
||||||
Chat.all_received += 1;
|
Chat.all_received += 1;
|
||||||
$("#favicon").attr("href", "/assets/images/highlogo.png");
|
$("#favicon").attr("href", "/assets/images/highlogo.png");
|
||||||
@@ -102,9 +102,9 @@ var Chat = {
|
|||||||
var in_text = document.createTextNode(inp.msg);
|
var in_text = document.createTextNode(inp.msg);
|
||||||
$("#chatall li:last")[0].appendChild(in_text);
|
$("#chatall li:last")[0].appendChild(in_text);
|
||||||
document.getElementById("chatall").scrollTop = document.getElementById("chatall").scrollHeight;
|
document.getElementById("chatall").scrollTop = document.getElementById("chatall").scrollHeight;
|
||||||
},
|
},
|
||||||
|
|
||||||
channelchat: function(data) {
|
channelchat: function(data) {
|
||||||
if(data.msg.substring(0,1) == ":" && !chat_active) {
|
if(data.msg.substring(0,1) == ":" && !chat_active) {
|
||||||
$("#favicon").attr("href", "/assets/images/highlogo.png");
|
$("#favicon").attr("href", "/assets/images/highlogo.png");
|
||||||
unseen = true;
|
unseen = true;
|
||||||
@@ -134,9 +134,9 @@ var Chat = {
|
|||||||
var in_text = document.createTextNode(data.msg);
|
var in_text = document.createTextNode(data.msg);
|
||||||
$("#chatchannel li:last")[0].appendChild(in_text);
|
$("#chatchannel li:last")[0].appendChild(in_text);
|
||||||
document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight;
|
document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight;
|
||||||
},
|
},
|
||||||
|
|
||||||
chat_blink: function() {
|
chat_blink: function() {
|
||||||
blinking = true;
|
blinking = true;
|
||||||
$(".chat-link").attr("style", "color: grey !important;");
|
$(".chat-link").attr("style", "color: grey !important;");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
@@ -145,5 +145,5 @@ var Chat = {
|
|||||||
if(blinking) Chat.chat_blink();
|
if(blinking) Chat.chat_blink();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user