From c1ee72db0f3107a97f6a4273a0ea3fed5c4c30e2 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 4 Jun 2020 21:15:14 +0200 Subject: [PATCH] Use PresenceState from ruma_common --- Cargo.toml | 10 +++++----- src/presence.rs | 17 +---------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c9cef627..87406b3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,18 +14,18 @@ edition = "2018" [dependencies] 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-identifiers = "0.16.1" -ruma-serde = "0.2.1" -serde = { version = "1.0.110", features = ["derive"] } +ruma-identifiers = "0.16.2" +ruma-serde = "0.2.2" +serde = { version = "1.0.111", features = ["derive"] } serde_json = { version = "1.0.53", features = ["raw_value"] } strum = { version = "0.18.0", features = ["derive"] } [dev-dependencies] maplit = "1.0.2" matches = "0.1.8" -ruma-identifiers = { version = "0.16.1", features = ["rand"] } +ruma-identifiers = { version = "0.16.2", features = ["rand"] } [workspace] members = [ diff --git a/src/presence.rs b/src/presence.rs index f168d970..36f97ee6 100644 --- a/src/presence.rs +++ b/src/presence.rs @@ -3,8 +3,6 @@ use js_int::UInt; use ruma_events_macros::ruma_event; use ruma_identifiers::UserId; -use serde::{Deserialize, Serialize}; -use strum::{Display, EnumString}; ruma_event! { /// 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. -#[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, -} +pub use ruma_common::presence::PresenceState; #[cfg(test)] mod tests {