aboutsummaryrefslogtreecommitdiffstats
path: root/mumlib
diff options
context:
space:
mode:
authorKapten Z∅∅m <55669224+default-username-852@users.noreply.github.com>2020-12-24 06:53:19 +0100
committerGitHub <noreply@github.com>2020-12-24 06:53:19 +0100
commit58947a7a3acaa1ae04887723643a49db76479f00 (patch)
tree66aeb40782bdb904adb21e6940679cb432ff0d83 /mumlib
parentc38ec422588c5b5f1f6701a698dff5eeff30f0f2 (diff)
parentded5b573004f867bc9fe9644d4d4fe3a81c48b99 (diff)
downloadmum-58947a7a3acaa1ae04887723643a49db76479f00.tar.gz
Merge pull request #32 from sornas/mumble-protocol-cleanup
remove mumlibs dependency on rust-mumble-protocol
Diffstat (limited to 'mumlib')
-rw-r--r--mumlib/Cargo.toml1
-rw-r--r--mumlib/src/state.rs66
2 files changed, 1 insertions, 66 deletions
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<String>,
- pub hash: Option<String>,
- pub name: Option<String>,
- pub priority_speaker: Option<bool>,
- pub recording: Option<bool>,
-
- pub suppress: Option<bool>, // by me
- pub self_mute: Option<bool>, // by self
- pub self_deaf: Option<bool>, // by self
- pub mute: Option<bool>, // by admin
- pub deaf: Option<bool>, // by admin
-
- pub channel_id: Option<u32>,
-}
-
-impl UserDiff {
- pub fn new() -> Self {
- UserDiff::default()
- }
-}
-
-impl From<msgs::UserState> 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