···44import { parse_isupport } from "./isupport";
55import { IrcMessage } from "./parser";
66import { IrcChannelState, Numeric } from "./support";
77+import { DirectMessage } from "./direct";
7889export type MessageHandler = (message: IrcMessage, connection: Connection) => Promise<void>;
910···103104 : null;
104105 });
105106107107+ break;
108108+ }
109109+110110+ case "PRIVMSG": {
111111+ if (message.source && message.params?.[0] == connection.nickname) {
112112+ const nick = message.source?.nick;
113113+ if (connection.$buffers.value.find(x => x.name == nick)) break;
114114+ const buf = new DirectMessage(nick, connection);
115115+ connection.$buffers.value = [...connection.$buffers.value, buf];
116116+ }
106117 break;
107118 }
108119
+9-4
core/history.ts
···11import { Connection } from "./index";
22import { IrcMessage } from "./parser";
33+import { ChatBuffer } from "./buffer";
3445export type FetchHistoryParams
56 = [
66- target: string,
77- range: { before: Date, }
77+ target: string,
88+ range: { before: Date, }
89 | { after: Date, }
910 | { during: [Date, Date] }
1011 | "latest",
1111- limit: number
1212- ]
1212+ limit: number
1313+]
13141415/**
1516 * History fetchers fetch history from locations.
···41424243 return await conn.collect_batch("chathistory", { mask: true, params: [target] });
4344}
4545+4646+export async function chathistory_targets(conn: Connection): Promise<ChatBuffer[]> {
4747+ return []
4848+}
+2
core/ws/connection.ts
···9999 this.$buffers.value = channels;
100100 }
101101102102+103103+102104 // do this /after/ getting the motd to avoid it being missing
103105 // when the connection opens.
104106 // this feels incorrect, but who gives a shit