diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-06-07 17:17:41 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-06-07 17:17:41 +0200 |
| commit | f22d3847a23484122fad83b22d7ca48316c9d7cd (patch) | |
| tree | b8289620e36d4bd50799eb81f547f418318c9ade /mumlib/src/command.rs | |
| parent | 17f077d48b361a4cf8f5743750ca7408a8800797 (diff) | |
| download | mum-f22d3847a23484122fad83b22d7ca48316c9d7cd.tar.gz | |
additional events
Diffstat (limited to 'mumlib/src/command.rs')
| -rw-r--r-- | mumlib/src/command.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 402d6b0..818fd70 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -20,8 +20,15 @@ impl fmt::Display for MumbleEvent { 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), + TextMessageReceived(String), + UserJoinedChannel(String, String), + UserLeftChannel(String, String), } +//TODO These strings are (mostly) duplicated with their respective notifications. +// The only difference is that the text message event doesn't contain the text message. impl fmt::Display for MumbleEventKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { @@ -31,6 +38,19 @@ impl fmt::Display for MumbleEventKind { MumbleEventKind::UserDisconnected(user, channel) => { write!(f, "{} disconnected from {}", user, channel.as_deref().unwrap_or("unknown channel")) } + MumbleEventKind::UserMuteStateChanged(message) => { + write!(f, "{}", message) + } + MumbleEventKind::TextMessageReceived(user) => { + write!(f, "{} sent a text message", user) + } + MumbleEventKind::UserJoinedChannel(name, from) => { + write!(f, "{} moved to your channel from {}", name, from) + } + MumbleEventKind::UserLeftChannel(name, to) => { + write!(f, "{} moved to {}", name, to) + } + } } } |
