diff --git a/lib/server/connection.ml b/lib/server/connection.ml index 5c0e596..ab4f589 100644 --- a/lib/server/connection.ml +++ b/lib/server/connection.ml @@ -49,9 +49,11 @@ let attempt_to_register t = begin match User.set_nick t.user nick ~router:t.router with | `nick_in_use -> `nicknameinuse nick | `nick_set -> - let mode_str = Fmt.str "+%a" Irc.Mode.pp t.user.mode in - let mode_msg = Irc.Msg.make "MODE" [nick; mode_str] in + + (* TODO: this sucks, fix it *) + let mode_msg = Irc.Msg.make "MODE" [nick; "+iw"] in defer (fun () -> Router.relay mode_msg ~from:t.user `to_self); + `welcome end | _, _ -> `ok @@ -187,11 +189,6 @@ let on_msg_quit t reason = let srv_host = "irc.tali.software" let srv_ver = "0.0.0" let srv_created = "Sun Jan 7 09:58:24 PM EST 2024" -let srv_isupport = [ - "CASEMAPPING=ascii"; - "CHANTYPES=#"; - "PREFIX=(ov)@+"; -] let srv_motd_lines = [ "MEOW MEOW MEOW MEOW MEOW"; "meow meow meow meow meow"; @@ -207,12 +204,18 @@ let rpl_tryagain t cmd = rpl t "263" [cmd; "Please wait a while and try again."] let rpl_welcome t = let who = Irc.Msg.prefix_string (User.prefix t.user) in + let isupport = [ + "CASEMAPPING=ascii"; + "CHANTYPES=#"; + "CHANMODES=b,k,l,imstn"; + "PREFIX=(ov)@+"; + ] in begin rpl t "001" [Fmt.str "Welcome to the tali IRC network %s" who]; rpl t "002" [Fmt.str "Your host is %s, running version %s" srv_host srv_ver]; rpl t "003" [Fmt.str "This server was created %s" srv_created]; - rpl t "004" [srv_host; srv_ver; "aiwroOs"; "oinvm"]; - rpl t "005" (srv_isupport @ ["are supported by this server"]); + rpl t "004" [srv_host; srv_ver; "iow"; "imnst"; "bklov"]; + rpl t "005" (isupport @ ["are supported by this server"]); end let rpl_motd t = diff --git a/lib/server/router.ml b/lib/server/router.ml index 95e2dc4..0440d2b 100644 --- a/lib/server/router.ml +++ b/lib/server/router.ml @@ -11,7 +11,6 @@ and user = { mutable nick : Irc.name; mutable nick_key : string_ci; mutable userinfo : Irc.userinfo option; - mutable mode : Irc.Mode.t; mutable membership : membership Dllist.t; } @@ -76,7 +75,7 @@ module User = struct nick = "*"; nick_key = empty_string_ci; userinfo = None; - mode = Irc.Mode.of_string "iw"; + (* mode = "+iw"; *) membership = Dllist.create (); }