mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
Handle FAIL ACCOUNT_REQUIRED
This commit is contained in:
parent
305f510501
commit
f9ec578fce
1 changed files with 17 additions and 3 deletions
|
@ -362,7 +362,9 @@ export default class Client extends EventTarget {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "ERROR":
|
case "ERROR":
|
||||||
this.dispatchEvent(new CustomEvent("error", { detail: "Fatal IRC error: " + msg.params[0] }));
|
this.dispatchEvent(new CustomEvent("error", {
|
||||||
|
detail: "Fatal IRC error: " + msg.params[0],
|
||||||
|
}));
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
break;
|
break;
|
||||||
case irc.ERR_PASSWDMISMATCH:
|
case irc.ERR_PASSWDMISMATCH:
|
||||||
|
@ -372,15 +374,27 @@ export default class Client extends EventTarget {
|
||||||
case irc.ERR_UNAVAILRESOURCE:
|
case irc.ERR_UNAVAILRESOURCE:
|
||||||
case irc.ERR_NOPERMFORHOST:
|
case irc.ERR_NOPERMFORHOST:
|
||||||
case irc.ERR_YOUREBANNEDCREEP:
|
case irc.ERR_YOUREBANNEDCREEP:
|
||||||
this.dispatchEvent(new CustomEvent("error", { detail: "Error (" + msg.command + "): " + msg.params[msg.params.length - 1] }));
|
this.dispatchEvent(new CustomEvent("error", {
|
||||||
|
detail: "Error (" + msg.command + "): " + msg.params[msg.params.length - 1],
|
||||||
|
}));
|
||||||
if (this.status != Client.Status.REGISTERED) {
|
if (this.status != Client.Status.REGISTERED) {
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "FAIL":
|
case "FAIL":
|
||||||
|
if (this.status === Client.Status.REGISTERED) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
let reason = msg.params[msg.params.length - 1];
|
||||||
if (msg.params[0] === "BOUNCER" && msg.params[2] === "BIND") {
|
if (msg.params[0] === "BOUNCER" && msg.params[2] === "BIND") {
|
||||||
this.dispatchEvent(new CustomEvent("error", {
|
this.dispatchEvent(new CustomEvent("error", {
|
||||||
detail: "Failed to bind to bouncer network: " + msg.params[3],
|
detail: "Failed to bind to bouncer network: " + reason,
|
||||||
|
}));
|
||||||
|
this.disconnect();
|
||||||
|
}
|
||||||
|
if (msg.params[1] === "ACCOUNT_REQUIRED") {
|
||||||
|
this.dispatchEvent(new CustomEvent("error", {
|
||||||
|
detail: reason,
|
||||||
}));
|
}));
|
||||||
this.disconnect();
|
this.disconnect();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue