diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/client.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/client.js b/lib/client.js index af5a33d..8915232 100644 --- a/lib/client.js +++ b/lib/client.js @@ -5,7 +5,6 @@ import * as irc from "./irc.js"; const permanentCaps = [ "account-notify", "away-notify", - "batch", "chghost", "echo-message", "extended-join", @@ -184,10 +183,6 @@ export default class Client extends EventTarget { this.ws.addEventListener("close", (event) => { console.log("Connection closed (code: " + event.code + ")"); - if (event.code !== NORMAL_CLOSURE && event.code !== GOING_AWAY) { - this.dispatchError(new Error("Connection error")); - } - this.ws = null; this.setStatus(Client.Status.DISCONNECTED); this.nick = null; @@ -494,9 +489,11 @@ export default class Client extends EventTarget { throw new IRCError(msg); } }); - for (let msg of irc.generateAuthenticateMessages(initialResp)) { - this.send(msg); - } + setTimeout(() => { + for (let msg of irc.generateAuthenticateMessages(initialResp)) { + this.send(msg); + } + }, 5000); return promise; } @@ -686,7 +683,9 @@ export default class Client extends EventTarget { this.send({ command: "BOUNCER", params: ["BIND", this.params.bouncerNetwork] }); } - this.send({ command: "CAP", params: ["END"] }); + setTimeout(() => { + this.send({ command: "CAP", params: ["END"] }) + }, 8000); } break; case "NEW": |