More fixes

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-13 17:44:16 +01:00
parent 6de7391be3
commit c0400d7999
10 changed files with 46 additions and 35 deletions

View File

@@ -83,6 +83,7 @@ var Admin = {
/*if(Crypt.get_pass(chan.toLowerCase())) {*/
//Crypt.remove_pass(chan.toLowerCase());
Admin.display_logged_out();
console.log(Admin.logged_in);
if(Admin.logged_in) {
socket.emit("logout");
Materialize.toast("Logged out", 4000);

View File

@@ -131,6 +131,8 @@ var Channel = {
Crypt.init();
Chat.namechange("", true, true);
setup_auth_listener();
if(Crypt.get_offline()){

View File

@@ -4,7 +4,7 @@ var Chat = {
all_received: 0,
chat_help: ["/name <new name> <password> to register and save a password for a nickname", "/name <new name> <new_password> <old_password> to change the password on a nickname", "/removename to logout"],//, "There are no commands.. As of now!"],
namechange: function(data, first) {
namechange: function(data, first, initial) {
var input = data.split(" ");
if(input.length == 2) {
var name = input[0];
@@ -17,14 +17,14 @@ var Chat = {
var new_password = input[1];
var old_password = input[2];
new_password = Crypt.crypt_chat_pass(new_password);
old_password = Crypt.crypt_chat_pass(old_password);
socket.emit("namechange", {name: name, channel: chan.toLowerCase(), new_password: new_password, old_password: old_password});
} else {
} else if(first) {
socket.emit("namechange", {channel: chan.toLowerCase(), initial: initial, first: true});
}
},

View File

@@ -30,11 +30,6 @@ var Crypt = {
Hostcontroller.change_enabled(conf_arr.remote);
if(conf_arr.width != 100) Player.set_width(conf_arr.width);
if(conf_arr.name !== undefined && conf_arr.name !== "" && conf_arr.chat_pass !== undefined && conf_arr.chat_pass !== ""){
setTimeout(function() {
Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass, true);
}, 100); //to take height for delay on establishing connection
}
}
},

View File

@@ -199,10 +199,8 @@ $().ready(function(){
/*if(chan != undefined && (Crypt.get_pass(chan.toLowerCase()) !== undefined && Crypt.get_pass(chan.toLowerCase()) !== "")){
emit("password", {password: Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())), channel: chan.toLowerCase()});
}*/
if(chan != undefined && conf_arr.name !== undefined && conf_arr.name !== "" && conf_arr.chat_pass !== undefined && conf_arr.chat_pass !== ""){
setTimeout(function() {
Chat.namechange(conf_arr.name + " " + conf_arr.chat_pass, true);
}, 100); //to take height for delay on establishing connection
if(chan != undefined) {
Chat.namechange("", true, true);
}
$(".connect_error").fadeOut(function(){
$(".connect_error").remove();