diff --git a/lib/server/connection.ml b/lib/server/connection.ml index 5420c8d..b89b04e 100644 --- a/lib/server/connection.ml +++ b/lib/server/connection.ml @@ -270,8 +270,9 @@ let dispatch t = function | "USER", unm :: _ :: _ :: rnm :: _ -> on_msg_user t unm rnm | "QUIT", why -> on_msg_quit t why | "MOTD", _ -> on_msg_motd t + | "PRIVMSG", ([] | "" :: _) -> Error norecipient + | "PRIVMSG", ([_] | _ :: "" :: _) -> Error notexttosend | "PRIVMSG", tgt :: msg :: _ -> on_msg_privmsg t tgt msg - | "PRIVMSG", [_] -> Error notexttosend | "PRIVMSG", [] -> Error norecipient | "JOIN", tgt :: _ when tgt <> "" -> on_msg_join t tgt | "NAMES", tgt :: _ when tgt <> "" -> on_msg_names t tgt | "PART", tgt :: _ when tgt <> "" -> on_msg_part t tgt