From ded5b573004f867bc9fe9644d4d4fe3a81c48b99 Mon Sep 17 00:00:00 2001 From: Eskil Q Date: Wed, 23 Dec 2020 19:53:36 +0100 Subject: remove mumlibs dependency on rust-mumble-protocol --- mumlib/Cargo.toml | 1 - mumlib/src/state.rs | 66 +---------------------------------------------------- 2 files changed, 1 insertion(+), 66 deletions(-) (limited to 'mumlib') diff --git a/mumlib/Cargo.toml b/mumlib/Cargo.toml index 59feb75..74bdb32 100644 --- a/mumlib/Cargo.toml +++ b/mumlib/Cargo.toml @@ -11,6 +11,5 @@ edition = "2018" colored = "2.0" fern = "0.5" log = "0.4" -mumble-protocol = "0.3" serde = { version = "1.0", features = ["derive"] } toml = "0.5" diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs index 3b1da56..0f1cef2 100644 --- a/mumlib/src/state.rs +++ b/mumlib/src/state.rs @@ -1,4 +1,3 @@ -use mumble_protocol::control::msgs; use serde::export::Formatter; use serde::{Deserialize, Serialize}; use std::fmt::Display; @@ -153,67 +152,4 @@ impl Display for User { true_to_str!(self.deaf, "d") ) } -} - -#[derive(Debug, Default)] -pub struct UserDiff { - pub comment: Option, - pub hash: Option, - pub name: Option, - pub priority_speaker: Option, - pub recording: Option, - - pub suppress: Option, // by me - pub self_mute: Option, // by self - pub self_deaf: Option, // by self - pub mute: Option, // by admin - pub deaf: Option, // by admin - - pub channel_id: Option, -} - -impl UserDiff { - pub fn new() -> Self { - UserDiff::default() - } -} - -impl From for UserDiff { - fn from(mut msg: msgs::UserState) -> Self { - let mut ud = UserDiff::new(); - if msg.has_comment() { - ud.comment = Some(msg.take_comment()); - } - if msg.has_hash() { - ud.hash = Some(msg.take_hash()); - } - if msg.has_name() { - ud.name = Some(msg.take_name()); - } - if msg.has_priority_speaker() { - ud.priority_speaker = Some(msg.get_priority_speaker()); - } - if msg.has_recording() { - ud.recording = Some(msg.get_recording()); - } - if msg.has_suppress() { - ud.suppress = Some(msg.get_suppress()); - } - if msg.has_self_mute() { - ud.self_mute = Some(msg.get_self_mute()); - } - if msg.has_self_deaf() { - ud.self_deaf = Some(msg.get_self_deaf()); - } - if msg.has_mute() { - ud.mute = Some(msg.get_mute()); - } - if msg.has_deaf() { - ud.deaf = Some(msg.get_deaf()); - } - if msg.has_channel_id() { - ud.channel_id = Some(msg.get_channel_id()); - } - ud - } -} +} \ No newline at end of file -- cgit v1.2.1