mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-08-05 16:59:10 +00:00
18 lines
No EOL
529 B
TypeScript
18 lines
No EOL
529 B
TypeScript
import { IRCUser } from "./IRCUser.js"
|
|
|
|
export class Server {
|
|
public name: string
|
|
public ircUsers: Map<string, IRCUser>
|
|
constructor(public config: any) {
|
|
this.name = this.config.serverName;
|
|
this.ircUsers = new Map();
|
|
}
|
|
|
|
getOrCreateIRCUser(mxid: string, accessToken: string, homeserver: string): IRCUser {
|
|
const maybeUser = this.ircUsers.get(mxid);
|
|
if (maybeUser) {
|
|
return maybeUser;
|
|
}
|
|
return new IRCUser(mxid, accessToken, homeserver, this);
|
|
}
|
|
} |