correctly handle some BS edge cases for PRIVMSG

This commit is contained in:
tali 2024-01-11 22:14:23 -05:00
parent 8b76a2b6db
commit b868915d64
1 changed files with 2 additions and 1 deletions

View File

@ -270,8 +270,9 @@ let dispatch t = function
| "USER", unm :: _ :: _ :: rnm :: _ -> on_msg_user t unm rnm | "USER", unm :: _ :: _ :: rnm :: _ -> on_msg_user t unm rnm
| "QUIT", why -> on_msg_quit t why | "QUIT", why -> on_msg_quit t why
| "MOTD", _ -> on_msg_motd t | "MOTD", _ -> on_msg_motd t
| "PRIVMSG", ([] | "" :: _) -> Error norecipient
| "PRIVMSG", ([_] | _ :: "" :: _) -> Error notexttosend
| "PRIVMSG", tgt :: msg :: _ -> on_msg_privmsg t tgt msg | "PRIVMSG", tgt :: msg :: _ -> on_msg_privmsg t tgt msg
| "PRIVMSG", [_] -> Error notexttosend | "PRIVMSG", [] -> Error norecipient
| "JOIN", tgt :: _ when tgt <> "" -> on_msg_join t tgt | "JOIN", tgt :: _ when tgt <> "" -> on_msg_join t tgt
| "NAMES", tgt :: _ when tgt <> "" -> on_msg_names t tgt | "NAMES", tgt :: _ when tgt <> "" -> on_msg_names t tgt
| "PART", tgt :: _ when tgt <> "" -> on_msg_part t tgt | "PART", tgt :: _ when tgt <> "" -> on_msg_part t tgt