mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-08-05 16:59:10 +00:00
Fix missing parameter for 900, catch connection error
This commit is contained in:
parent
fa58928ec2
commit
021e2920ab
2 changed files with 6 additions and 8 deletions
|
@ -188,8 +188,8 @@ export class Client {
|
||||||
this.closeConnectionWithError('access token does not match mxid, please check credentials')
|
this.closeConnectionWithError('access token does not match mxid, please check credentials')
|
||||||
} else {
|
} else {
|
||||||
this.user = thisIRCUser;
|
this.user = thisIRCUser;
|
||||||
this.sendMessage(this.server.name, '900', numerics['900'](this.user.getMask(), 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', numerics['903'](this.user.nick));
|
this.sendMessage(this.server.name, '903', [this.user.nick, "SASL authentication successful"]);
|
||||||
if (this.user.isSynced()) {
|
if (this.user.isSynced()) {
|
||||||
this.user.addClient(this);
|
this.user.addClient(this);
|
||||||
} else {
|
} 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')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,12 +38,6 @@ const numerics = {
|
||||||
"433": (nick: string, otherNick: string) => {
|
"433": (nick: string, otherNick: string) => {
|
||||||
return [nick, otherNick, "Nickname is already in use"]
|
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) => {
|
"904": (nick: string) => {
|
||||||
return [nick, "SASL authentication failed"]
|
return [nick, "SASL authentication failed"]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue