54 lines
1.1 KiB
OCaml
54 lines
1.1 KiB
OCaml
open! Import
|
|
|
|
type t = {
|
|
version : string;
|
|
created : string;
|
|
hostname : string;
|
|
motd : string list;
|
|
conf : conf;
|
|
}
|
|
|
|
and conf = {
|
|
isupport : string list;
|
|
all_umodes : Mode.user list;
|
|
all_cmodes : Mode.chan_d list;
|
|
all_pmodes : [Mode.chan_a | Mode.chan_b | Mode.chan_c] list;
|
|
init_umode : Mode.Set.t;
|
|
init_cmode : Mode.Set.t;
|
|
}
|
|
|
|
let isupport = [
|
|
"CASEMAPPING=ascii";
|
|
"CHANTYPES=#";
|
|
"CHANMODES=b,k,l,imstn";
|
|
"PREFIX=(ov)@+";
|
|
]
|
|
|
|
let default_conf = {
|
|
isupport;
|
|
all_umodes = [`i; `o; `w];
|
|
all_cmodes = [`i; `m; `n; `s; `t];
|
|
all_pmodes = [`b; `k; `l; `o; `v];
|
|
init_umode = Mode.Set.of_list [`i; `w];
|
|
init_cmode = Mode.Set.of_list [`n; `s; `t];
|
|
}
|
|
|
|
let make ~hostname = {
|
|
version =
|
|
(* TODO: generate version string at build time? *)
|
|
"0.0.0";
|
|
created =
|
|
(* TODO: stringify timestamp *)
|
|
"Sun Jan 7 09:58:24 PM EST 2024";
|
|
hostname;
|
|
motd = [
|
|
(* TODO: load from file *)
|
|
"MEOW MEOW MEOW MEOW MEOW";
|
|
"meow meow meow meow meow";
|
|
"meowmeowmeowmeowmeowmeow";
|
|
];
|
|
conf = default_conf;
|
|
}
|
|
|
|
let prefix t = Msg.Server_prefix t.hostname
|