Added support for cap-notify extension.
This commit is contained in:
parent
5d6fd1031d
commit
d773dafb22
2 changed files with 13 additions and 1 deletions
|
@ -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<str> 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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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."),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue