mirror of
https://git.sr.ht/~emerson/reflectionircd
synced 2025-08-05 16:59:10 +00:00
31 lines
No EOL
1.1 KiB
TypeScript
31 lines
No EOL
1.1 KiB
TypeScript
import { Server } from "./Server.js";
|
|
import { MatrixUser } from "./MatrixUser.js";
|
|
import { IRCUser } from "./IRCUser.js";
|
|
import { IRCMessage } from "./Message.js";
|
|
|
|
export class Channel {
|
|
public name: string
|
|
private matrixUsers: Map<string, MatrixUser>
|
|
private ircUsers: Map<string, IRCUser>
|
|
private nickToMXid: Map<string, string>
|
|
private powerLevels: Map<string, number>
|
|
private topic: Map<string, string>;
|
|
private memberCount: number;
|
|
private modes: Map<string, string>
|
|
private messages: Map<string, IRCMessage>;
|
|
private tsToEventId: Map<number, string>;
|
|
constructor(public roomId: string, private server: Server, initialIRCUser: IRCUser) {
|
|
this.name = roomId;
|
|
this.matrixUsers = new Map();
|
|
this.ircUsers = new Map();
|
|
this.ircUsers.set(initialIRCUser.nick, initialIRCUser);
|
|
this.nickToMXid = new Map();
|
|
this.powerLevels = new Map();
|
|
this.topic = new Map();
|
|
this.memberCount = 0;
|
|
this.modes = new Map();
|
|
this.modes.set('n', '');
|
|
this.messages = new Map();
|
|
this.tsToEventId = new Map();
|
|
}
|
|
} |