presence: Rename Available to None, since that’s what it is.
This commit is contained in:
parent
aae435c4d9
commit
32bfa84551
1 changed files with 4 additions and 4 deletions
|
|
@ -117,7 +117,7 @@ impl Into<Element> for PresencePayload {
|
||||||
pub enum PresenceType {
|
pub enum PresenceType {
|
||||||
/// This value is not an acceptable 'type' attribute, it is only used
|
/// This value is not an acceptable 'type' attribute, it is only used
|
||||||
/// internally to signal the absence of 'type'.
|
/// internally to signal the absence of 'type'.
|
||||||
Available,
|
None,
|
||||||
Error,
|
Error,
|
||||||
Probe,
|
Probe,
|
||||||
Subscribe,
|
Subscribe,
|
||||||
|
|
@ -129,7 +129,7 @@ pub enum PresenceType {
|
||||||
|
|
||||||
impl Default for PresenceType {
|
impl Default for PresenceType {
|
||||||
fn default() -> PresenceType {
|
fn default() -> PresenceType {
|
||||||
PresenceType::Available
|
PresenceType::None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ impl FromStr for PresenceType {
|
||||||
impl IntoAttributeValue for PresenceType {
|
impl IntoAttributeValue for PresenceType {
|
||||||
fn into_attribute_value(self) -> Option<String> {
|
fn into_attribute_value(self) -> Option<String> {
|
||||||
Some(match self {
|
Some(match self {
|
||||||
PresenceType::Available => return None,
|
PresenceType::None => return None,
|
||||||
|
|
||||||
PresenceType::Error => "error",
|
PresenceType::Error => "error",
|
||||||
PresenceType::Probe => "probe",
|
PresenceType::Probe => "probe",
|
||||||
|
|
@ -283,7 +283,7 @@ mod tests {
|
||||||
assert_eq!(presence.from, None);
|
assert_eq!(presence.from, None);
|
||||||
assert_eq!(presence.to, None);
|
assert_eq!(presence.to, None);
|
||||||
assert_eq!(presence.id, None);
|
assert_eq!(presence.id, None);
|
||||||
assert_eq!(presence.type_, PresenceType::Available);
|
assert_eq!(presence.type_, PresenceType::None);
|
||||||
assert!(presence.payloads.is_empty());
|
assert!(presence.payloads.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue