diff --git a/src/client/data/command.rs b/src/client/data/command.rs index b71c789..731cb49 100644 --- a/src/client/data/command.rs +++ b/src/client/data/command.rs @@ -155,6 +155,10 @@ pub enum Command { // AWAY(Option), // JOIN is already defined. // JOIN(String, Option, Option), + + // IRCv3.2 extensions + /// MONITOR command [nicklist] + MONITOR(String, Option) } impl Into for Command { @@ -326,6 +330,11 @@ impl Into for Command { Command::ACCOUNT(a) => Message::from_owned(None, string("ACCOUNT"), Some(vec![a]), None), + + Command::MONITOR(c, Some(t)) => + Message::from_owned(None, string("MONITOR"), Some(vec![c, t]), None), + Command::MONITOR(c, None) => + Message::from_owned(None, string("MONITOR"), Some(vec![c]), None), } } } @@ -1066,6 +1075,12 @@ impl Command { return Err(invalid_input()) } } + } else if let "MONITOR" = &m.command[..] { + if m.args.len() == 1 { + Command::MONITOR(m.args[0].clone(), m.suffix.clone()) + } else { + return Err(invalid_input()) + } } else { return Err(invalid_input()) })