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 capsToChange = (message.params[1].indexOf(' ') === -1) ? [message.params[1]] : message.params[1].split(' ');
|
||||||
const capsEnabled: string[] = [];
|
const capsEnabled: string[] = [];
|
||||||
capsToChange.forEach(cap => {
|
capsToChange.forEach(cap => {
|
||||||
if (cap in this.allCaps) {
|
if (this.allCaps.get(cap)) {
|
||||||
this.enabledCaps.set(cap, '');
|
this.enabledCaps.set(cap, '');
|
||||||
capsEnabled.push(cap);
|
capsEnabled.push(cap);
|
||||||
}
|
}
|
||||||
|
@ -126,14 +126,19 @@ export class Client {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.user = thisIRCUser;
|
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) {
|
doRegistration(message: IRCMessage) {
|
||||||
if (this.user === null) {
|
if (this.user === null) {
|
||||||
this.closeConnectionWithError('Authentication failed');
|
this.closeConnectionWithError("You must use SASL to connect to this server");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.sendMessage(this.server.name, '001', numerics['001'](this.user.nick, this.server.name), message.tags);
|
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 {
|
verifyCredentials(accessToken: string): boolean {
|
||||||
return accessToken === this.accessToken;
|
return accessToken === this.accessToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMask(): string {
|
||||||
|
return `${this.nick}!${this.ident}@${this.hostname}`;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue