diff --git a/src/Client.ts b/src/Client.ts index 0003bc4..f22657c 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -188,8 +188,8 @@ export class Client { this.closeConnectionWithError('access token does not match mxid, please check credentials') } else { this.user = thisIRCUser; - this.sendMessage(this.server.name, '900', numerics['900'](this.user.getMask(), this.user.nick)); - this.sendMessage(this.server.name, '903', numerics['903'](this.user.nick)); + this.sendMessage(this.server.name, '900', [this.user.nick, this.user.getMask(), this.user.accountName, `You are now logged in as ${this.user.nick}`]); + this.sendMessage(this.server.name, '903', [this.user.nick, "SASL authentication successful"]); if (this.user.isSynced()) { this.user.addClient(this); } else { @@ -214,6 +214,10 @@ export class Client { }) } } + }).catch((error) => { + console.log(error); + this.sendMessage(this.server.name, '904', numerics['904']('*')) + this.closeConnectionWithError('Error connecting to the Matrix server') }) } } diff --git a/src/numerics.ts b/src/numerics.ts index 628a8bc..de3778b 100644 --- a/src/numerics.ts +++ b/src/numerics.ts @@ -38,12 +38,6 @@ const numerics = { "433": (nick: string, otherNick: string) => { return [nick, otherNick, "Nickname is already in use"] }, - "900": (mask: string, nick: string) => { - return [nick, mask, `You are now logged in as ${nick}`] - }, - "903": (nick: string) => { - return [nick, "SASL authentication successful"] - }, "904": (nick: string) => { return [nick, "SASL authentication failed"] },