Skip to content

Commit

Permalink
Correction: "Cannot create property 'mobile' on boolean 'false'"
Browse files Browse the repository at this point in the history
  • Loading branch information
Madriix committed Apr 22, 2024
1 parent 2d8a784 commit a550d20
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
14 changes: 8 additions & 6 deletions bouncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ global.SERVER = global.BOUNCER_MODE == 'gateway' ? (config.server ? config.serve
global.MSG_REDISTRIBUTION = config.MsgRedistribution ? true : false;
global.DEBUG = config.debug ? config.debug : false;
global.WEBIRCSPECIAL = config.webircSpecial ? config.webircSpecial : false;
global.IRC_STANDARDS = config.ircStandards ? config.ircStandards : true;
global.UNCAUGHTEXCEPTION = config.uncaughtException ? config.uncaughtException : true;

global.ircCommandList = new Set(["JOIN", "PART", "QUIT", "MODE", "PING", "NICK", "KICK"]);
global.ircCommandRedistributeMessagesOnConnect = new Set(["AWAY", "NICK", "ACCOUNT", "PART", "QUIT", "MODE", "KICK", "TOPIC"]);
Expand All @@ -53,12 +55,12 @@ process.on('SIGHUP', function () {
global.BOUNCER_ADMIN = config.bouncerAdmin ? config.bouncerAdmin : '';
});

/*
// Prevent BNC from crashing for all other users when an error is caused by a user (with log error and time)
process.on('uncaughtException', (err, origin) => {
console.error(`${parseInt(Number(new Date()) / 1000)} # Serious problem (${origin}) - this should not happen but the JBNC is still running. ${err.stack}`);
});
*/
if (global.UNCAUGHTEXCEPTION) {
// Prevent BNC from crashing for all other users when an error is caused by a user (with log error and time)
process.on('uncaughtException', (err, origin) => {
console.error(`${parseInt(Number(new Date()) / 1000)} # Serious problem (${origin}) - this should not happen but the JBNC is still running. ${err.stack}`);
});
}

const jBNC = require('./lib/Server');

Expand Down
40 changes: 30 additions & 10 deletions lib/ClientConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,23 +719,43 @@ class ClientConnect {
case '433': // ERR_NICKNAMEINUSE
if (this.client.parents.length == 0) {
if (data[2] == '*') {
if (global.DEBUG)
console.log("Une erreur 433 est détecté, un quit ?");
this.client.end();
/*this.write("NICK "+data[3].trim()+"_"+"\n");
this.nick=data[3].trim()+"_";*/
if (global.IRC_STANDARDS) {
this.write("NICK "+data[3].trim()+"_"+"\n");
this.nick=data[3].trim()+"_";
} else {
if (global.DEBUG)
console.log("ERROR 433 is detected. Quit ?");
this.client.end();
}
}
} else {
if (global.DEBUG)
console.log("ERROR 433 !this.client.parents.length is detected. Quit ?");
try {
this.connections[this.client.hash].end();
} catch (e) { }
delete this.connections[this.client.hash];
}
break;
case '451': // ERR_NOTREGISTERED
if (this.client.parents.length == 0) {
if (data[2] == '*') {
if (global.DEBUG)
console.log("Une erreur 451 est détecté, un quit ?");
this.client.end();
/*this.write("NICK "+data[3].trim()+"_"+"\n");
this.nick=data[3].trim()+"_";*/
if (global.IRC_STANDARDS) {
this.write("NICK "+data[3].trim()+"_"+"\n");
this.nick=data[3].trim()+"_";
} else {
if (global.DEBUG)
console.log("ERROR 451 is detected. Quit ?");
this.client.end();
}
}
} else {
if (global.DEBUG)
console.log("ERROR 451 !this.client.parents.length is detected. Quit ?");
try {
this.connections[this.client.hash].end();
} catch (e) { }
delete this.connections[this.client.hash];
}
break;
}
Expand Down

0 comments on commit a550d20

Please sign in to comment.