···1111import list_channels from "./list";
1212import { ChatBuffer } from "./buffer";
1313import FileHost from "./filehost";
1414+import Registration from "./registration";
14151516export interface ConnectionConfig {
1617 /**
···111112 Banned,
112113}
113114114114-const ping_interval = 30000;
115115+const pingterval = 30000;
115116116117export abstract class Connection {
117118 constructor(public config: ConnectionConfig, opt?: ConnectionParameters) {
···165166 $error: Signal<[code: ConnectionErrorCode, reason?: IrcMessage] | null> = signal(null);
166167167168 sasl?: Sasl;
169169+ registration: Registration = new Registration(this);
168170169171 abstract connect(): Promise<void>;
170172···229231 #ping_token = "tubes";
230232231233 /**
232232- * begin pinging the server every {@link ping_interval} milliseconds.
234234+ * begin pinging the server every {@link pingterval} milliseconds.
233235 *
234234- * this is only used if the server doesn't bother pinging the client itself.
236236+ * this is only used if the server doesn't bother pinging the client itself. update: this is no longer true.
237237+ * not pinging causes many interesting issues in safari and also chrome sometimes. i love browsers
235238 */
236239 protected start_pinging() {
237240 const token = crypto.randomUUID();
238241 this.#ping_token = token;
239242240243 setTimeout(() => {
241241- if (this.server_does_the_pinging) {
242242- return;
243243- }
244244+ // if (this.server_does_the_pinging) {
245245+ // return;
246246+ // }
244247245248 if (this.$state.value != ConnectionState.Connected) {
246249 return;
···255258256259 this.send(`PING ${this.#ping_token}`);
257260 this.start_pinging();
258258- }, ping_interval);
261261+ }, pingterval);
259262 }
260263261264 /**
···11import { IrcMessage } from "./parser";
2233+// thought of the day: maybe strongly typed objects are overrated
44+35/**
46 * everything that can be included in isupport
57 * as per the spec.