aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-06-08 09:46:59 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-06-08 09:46:59 +0200
commit2aafe6967e38851d56f747cb3e615da7e9fa9bf1 (patch)
treea83a32df551fd0b0ede161401cb30deab9fe7c88
parentf22d3847a23484122fad83b22d7ca48316c9d7cd (diff)
downloadmum-2aafe6967e38851d56f747cb3e615da7e9fa9bf1.tar.gz
doc
-rw-r--r--mumctl/src/main.rs1
-rw-r--r--mumd/src/state.rs1
-rw-r--r--mumlib/src/command.rs5
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),