mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-08-05 16:59:10 +00:00
get basic connection working
This commit is contained in:
parent
43e974f4c6
commit
4ffe157380
2 changed files with 11 additions and 2 deletions
|
@ -87,7 +87,7 @@ export class Client {
|
|||
const capsToChange = (message.params[1].indexOf(' ') === -1) ? [message.params[1]] : message.params[1].split(' ');
|
||||
const capsEnabled: string[] = [];
|
||||
capsToChange.forEach(cap => {
|
||||
if (cap in this.allCaps) {
|
||||
if (this.allCaps.get(cap)) {
|
||||
this.enabledCaps.set(cap, '');
|
||||
capsEnabled.push(cap);
|
||||
}
|
||||
|
@ -126,14 +126,19 @@ export class Client {
|
|||
}
|
||||
else {
|
||||
this.user = thisIRCUser;
|
||||
this.sendMessage(this.server.name, '900', numerics['900'](this.user.getMask(), this.user.nick), new Map());
|
||||
this.sendMessage(this.server.name, '903', numerics['903'](this.user.nick), new Map());
|
||||
}
|
||||
}
|
||||
this.user = thisIRCUser;
|
||||
this.sendMessage(this.server.name, '900', numerics['900'](this.user.getMask(), this.user.nick), new Map());
|
||||
this.sendMessage(this.server.name, '903', numerics['903'](this.user.nick), new Map());
|
||||
}
|
||||
}
|
||||
|
||||
doRegistration(message: IRCMessage) {
|
||||
if (this.user === null) {
|
||||
this.closeConnectionWithError('Authentication failed');
|
||||
this.closeConnectionWithError("You must use SASL to connect to this server");
|
||||
return;
|
||||
}
|
||||
this.sendMessage(this.server.name, '001', numerics['001'](this.user.nick, this.server.name), message.tags);
|
||||
|
|
|
@ -32,4 +32,8 @@ export class IRCUser {
|
|||
verifyCredentials(accessToken: string): boolean {
|
||||
return accessToken === this.accessToken;
|
||||
}
|
||||
|
||||
getMask(): string {
|
||||
return `${this.nick}!${this.ident}@${this.hostname}`;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue