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
|
||||
match result with
|
||||
| `ok -> ()
|
||||
| `quit -> close t
|
||||
| `quit -> cleanup t
|
||||
| `welcome -> rpl_welcome t; rpl_motd t
|
||||
| `names (cp, ch, us) -> rpl_names t cp ch us
|
||||
| `tryagain -> rpl_tryagain t msg.command
|
||||
|
|
|
@ -67,8 +67,14 @@ module User = struct
|
|||
end
|
||||
|
||||
let cleanup t =
|
||||
(* TODO: relay QUIT message *)
|
||||
unregister t;
|
||||
if is_registered t then begin
|
||||
(* 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
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue