Use PresenceState from ruma_common
This commit is contained in:
parent
61e6493432
commit
c1ee72db0f
10
Cargo.toml
10
Cargo.toml
@ -14,18 +14,18 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
js_int = { version = "0.1.5", features = ["serde"] }
|
js_int = { version = "0.1.5", features = ["serde"] }
|
||||||
ruma-common = "0.1.1"
|
ruma-common = "0.1.3"
|
||||||
ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.3" }
|
ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.3" }
|
||||||
ruma-identifiers = "0.16.1"
|
ruma-identifiers = "0.16.2"
|
||||||
ruma-serde = "0.2.1"
|
ruma-serde = "0.2.2"
|
||||||
serde = { version = "1.0.110", features = ["derive"] }
|
serde = { version = "1.0.111", features = ["derive"] }
|
||||||
serde_json = { version = "1.0.53", features = ["raw_value"] }
|
serde_json = { version = "1.0.53", features = ["raw_value"] }
|
||||||
strum = { version = "0.18.0", features = ["derive"] }
|
strum = { version = "0.18.0", features = ["derive"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
maplit = "1.0.2"
|
maplit = "1.0.2"
|
||||||
matches = "0.1.8"
|
matches = "0.1.8"
|
||||||
ruma-identifiers = { version = "0.16.1", features = ["rand"] }
|
ruma-identifiers = { version = "0.16.2", features = ["rand"] }
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
use js_int::UInt;
|
use js_int::UInt;
|
||||||
use ruma_events_macros::ruma_event;
|
use ruma_events_macros::ruma_event;
|
||||||
use ruma_identifiers::UserId;
|
use ruma_identifiers::UserId;
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use strum::{Display, EnumString};
|
|
||||||
|
|
||||||
ruma_event! {
|
ruma_event! {
|
||||||
/// Informs the client of a user's presence state change.
|
/// Informs the client of a user's presence state change.
|
||||||
@ -42,20 +40,7 @@ ruma_event! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A description of a user's connectivity and availability for chat.
|
pub use ruma_common::presence::PresenceState;
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)]
|
|
||||||
#[serde(rename_all = "snake_case")]
|
|
||||||
#[strum(serialize_all = "snake_case")]
|
|
||||||
pub enum PresenceState {
|
|
||||||
/// Disconnected from the service.
|
|
||||||
Offline,
|
|
||||||
|
|
||||||
/// Connected to the service.
|
|
||||||
Online,
|
|
||||||
|
|
||||||
/// Connected to the service but not available for chat.
|
|
||||||
Unavailable,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user