Handle ERR_PASSWDMISMATCH

This commit is contained in:
Simon Ser 2020-06-06 10:43:28 +02:00
parent a08fdeea8f
commit cb04f42fe7
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 9 additions and 0 deletions

View file

@ -200,6 +200,10 @@ function connect() {
console.log("Registration complete");
connectElt.style.display = "none";
break;
case ERR_PASSWDMISMATCH:
console.error("Password mismatch");
disconnect();
break;
case "NOTICE":
case "PRIVMSG":
var target = msg.params[0];
@ -252,6 +256,10 @@ function connect() {
switchBuffer(serverBuffer);
}
function disconnect() {
ws.close(1000);
}
function sendMessage(msg) {
ws.send(formatMessage(msg));
}

View file

@ -1,4 +1,5 @@
const RPL_WELCOME = "001";
const ERR_PASSWDMISMATCH = "464";
function parsePrefix(s) {
var prefix = {