fix quit logic; echo QUIT message
This commit is contained in:
parent
e7e641f266
commit
d340708d4f
|
@ -171,7 +171,7 @@ let on_msg t (msg : Irc.Msg.t) : unit =
|
||||||
in
|
in
|
||||||
match result with
|
match result with
|
||||||
| `ok -> ()
|
| `ok -> ()
|
||||||
| `quit -> close t
|
| `quit -> cleanup t
|
||||||
| `welcome -> rpl_welcome t; rpl_motd t
|
| `welcome -> rpl_welcome t; rpl_motd t
|
||||||
| `names (cp, ch, us) -> rpl_names t cp ch us
|
| `names (cp, ch, us) -> rpl_names t cp ch us
|
||||||
| `tryagain -> rpl_tryagain t msg.command
|
| `tryagain -> rpl_tryagain t msg.command
|
||||||
|
|
|
@ -67,8 +67,14 @@ module User = struct
|
||||||
end
|
end
|
||||||
|
|
||||||
let cleanup t =
|
let cleanup t =
|
||||||
(* TODO: relay QUIT message *)
|
if is_registered t then begin
|
||||||
unregister t;
|
(* TODO: quit reason *)
|
||||||
|
send t (Irc.Msg.make "QUIT" ["Closed"]
|
||||||
|
~prefix:(prefix t)
|
||||||
|
~always_trailing:true);
|
||||||
|
(* TODO: relay QUIT message *)
|
||||||
|
unregister t
|
||||||
|
end;
|
||||||
close t
|
close t
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue