diff options
| -rw-r--r-- | mumctl/src/main.rs | 1 | ||||
| -rw-r--r-- | mumd/src/state.rs | 1 | ||||
| -rw-r--r-- | mumlib/src/command.rs | 5 |
3 files changed, 5 insertions, 2 deletions
diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index 0af322d..f43dd22 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -87,6 +87,7 @@ enum Command { }, /// Send a message to a channel or a user Message(Target), + /// Get events that have happened since we connected Events { #[structopt(short = "f", long = "follow")] follow: bool, diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 3aa330f..d0a7e4b 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -297,6 +297,7 @@ impl State { .play_effect(NotificationEvents::ServerConnect); } + /// Store a new event pub fn push_event(&mut self, kind: MumbleEventKind) { self.events.push(MumbleEvent { timestamp: chrono::Local::now().naive_local(), kind }); } diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 818fd70..fff921a 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -4,6 +4,7 @@ use chrono::NaiveDateTime; use serde::{Deserialize, Serialize}; use std::fmt; +/// Something that happened in our channel at a point in time. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct MumbleEvent { pub timestamp: NaiveDateTime, @@ -16,12 +17,12 @@ impl fmt::Display for MumbleEvent { } } +/// The different kinds of events that can happen. #[derive(Debug, Clone, Serialize, Deserialize)] pub enum MumbleEventKind { UserConnected(String, Option<String>), UserDisconnected(String, Option<String>), - /// This logic is kinda weird so we only store the rendered message. - UserMuteStateChanged(String), + UserMuteStateChanged(String), // This logic is kinda weird so we only store the rendered message. TextMessageReceived(String), UserJoinedChannel(String, String), UserLeftChannel(String, String), |
