aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/state
diff options
context:
space:
mode:
authorEskil Queseth <eskilq@kth.se>2020-11-05 00:44:04 +0100
committerEskil Queseth <eskilq@kth.se>2020-11-05 00:44:04 +0100
commit22579ced3d1d847a14683fe3b47fa2076df01751 (patch)
tree507d5c8ba721fb31cd58c207be8c0d66e12595c6 /mumd/src/state
parent4dd73f7b837572211b71483d62bbdfb1227d2aee (diff)
downloadmum-22579ced3d1d847a14683fe3b47fa2076df01751.tar.gz
add mute feature
Diffstat (limited to 'mumd/src/state')
-rw-r--r--mumd/src/state/server.rs20
-rw-r--r--mumd/src/state/user.rs8
2 files changed, 28 insertions, 0 deletions
diff --git a/mumd/src/state/server.rs b/mumd/src/state/server.rs
index b99c7e6..a065df0 100644
--- a/mumd/src/state/server.rs
+++ b/mumd/src/state/server.rs
@@ -15,6 +15,8 @@ pub struct Server {
username: Option<String>,
session_id: Option<u32>,
+ muted: bool,
+ deafened: bool,
host: Option<String>,
}
@@ -27,6 +29,8 @@ impl Server {
welcome_text: None,
username: None,
session_id: None,
+ muted: false,
+ deafened: false,
host: None,
}
}
@@ -109,6 +113,22 @@ impl Server {
pub fn username_mut(&mut self) -> &mut Option<String> {
&mut self.username
}
+
+ pub fn muted(&self) -> bool {
+ self.muted
+ }
+
+ pub fn deafened(&self) -> bool {
+ self.deafened
+ }
+
+ pub fn set_muted(&mut self, value: bool) {
+ self.muted = value;
+ }
+
+ pub fn set_deafened(&mut self, value: bool) {
+ self.deafened = value;
+ }
}
impl From<&Server> for mumlib::state::Server {
diff --git a/mumd/src/state/user.rs b/mumd/src/state/user.rs
index 848208c..913f91b 100644
--- a/mumd/src/state/user.rs
+++ b/mumd/src/state/user.rs
@@ -129,6 +129,14 @@ impl User {
pub fn self_deaf(&self) -> bool {
self.self_deaf
}
+
+ pub fn suppressed(&self) -> bool {
+ self.suppress
+ }
+
+ pub fn set_suppressed(&mut self, value: bool) {
+ self.suppress = value;
+ }
}
impl From<&User> for mumlib::state::User {