diff --git a/src/client/data/caps.rs b/src/client/data/caps.rs index 5507ff2..2ee55b3 100644 --- a/src/client/data/caps.rs +++ b/src/client/data/caps.rs @@ -16,6 +16,8 @@ pub enum Capability { Monitor, /// [account-tag](http://ircv3.net/specs/extensions/account-tag-3.2.html) AccountTag, + /// [cap-notify](http://ircv3.net/specs/extensions/cap-notify-3.2.html) + CapNotify, } /// List of IRCv3 capability negotiation versions. @@ -35,6 +37,7 @@ impl AsRef for Capability { Capability::ExtendedJoin => "extended-join", Capability::Monitor => "monitor", Capability::AccountTag => "account-tag", + Capability::CapNotify => "cap-notify", } } } @@ -51,5 +54,6 @@ mod test { assert_eq!(ExtendedJoin.as_ref(), "extended-join"); assert_eq!(Monitor.as_ref(), "monitor"); assert_eq!(AccountTag.as_ref(), "account-tag"); + assert_eq!(CapNotify.as_ref(), "cap-notify"); } } diff --git a/src/client/data/command.rs b/src/client/data/command.rs index 731cb49..483661e 100644 --- a/src/client/data/command.rs +++ b/src/client/data/command.rs @@ -1106,7 +1106,11 @@ pub enum CapSubCommand { /// Does not acknowledge certain capabilities. NAK, /// Ends the capability negotiation before registration. - END + END, + /// Signals that new capabilities are now being offered. + NEW, + /// Signasl that the specified capabilities are cancelled and no longer available. + DEL, } impl CapSubCommand { @@ -1119,6 +1123,8 @@ impl CapSubCommand { &CapSubCommand::ACK => "ACK", &CapSubCommand::NAK => "NAK", &CapSubCommand::END => "END", + &CapSubCommand::NEW => "NEW", + &CapSubCommand::DEL => "DEL", } } @@ -1138,6 +1144,8 @@ impl FromStr for CapSubCommand { "ACK" => Ok(CapSubCommand::ACK), "NAK" => Ok(CapSubCommand::NAK), "END" => Ok(CapSubCommand::END), + "NEW" => Ok(CapSubCommand::NEW), + "DEL" => Ok(CapSubCommand::DEL), _ => Err("Failed to parse CAP subcommand."), } }