diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-06-11 17:25:02 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-06-11 17:25:02 +0200 |
| commit | 904a27493eb3e292d9e2bdeb71ff35f14e6919b3 (patch) | |
| tree | d518a68fabf1b32b5b5dde63d30012923a511ec4 | |
| parent | 89138b83c231259575970338eb719895bde881d9 (diff) | |
| parent | 271d95b60b9a2bacbb8357c89b84bb1461228dbb (diff) | |
| download | mum-904a27493eb3e292d9e2bdeb71ff35f14e6919b3.tar.gz | |
Merge remote-tracking branch 'origin/login-status'
| -rw-r--r-- | CHANGELOG | 1 | ||||
| -rw-r--r-- | mumctl/src/main.rs | 6 | ||||
| -rw-r--r-- | mumd/src/state.rs | 4 | ||||
| -rw-r--r-- | mumlib/src/command.rs | 1 |
4 files changed, 8 insertions, 4 deletions
@@ -28,6 +28,7 @@ Changed ~~~~~~~ * Changed how you mute yourself/others. See man pages for details on the new options. + * The current channel status is now printed when connecting to a server. // Removed // ~~~~~~~ diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index f704b19..2f1063f 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -268,10 +268,10 @@ fn match_opt() -> Result<(), Error> { password: password.map(|x| x.to_string()), accept_invalid_cert: true, //TODO })??; - if let Some(CommandResponse::ServerConnect { welcome_message }) = response { - println!("Connected to {}", host); + if let Some(CommandResponse::ServerConnect { welcome_message, server_state }) = response { + parse_state(&server_state); if let Some(message) = welcome_message { - println!("Welcome: {}", message); + println!("\nWelcome: {}", message); } } } diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 2cfdfb1..37dd6a2 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -605,7 +605,8 @@ pub fn handle_command( accept_invalid_cert, ))) .unwrap(); - at!(TcpEvent::Connected, |res| { + let state = Arc::clone(&og_state); + at!(TcpEvent::Connected, move |res| { //runs the closure when the client is connected if let TcpEventData::Connected(res) = res { Box::new(iter::once(res.map(|msg| { @@ -615,6 +616,7 @@ pub fn handle_command( } else { None }, + server_state: state.read().unwrap().server.as_ref().unwrap().into(), }) }))) } else { diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 48174fc..c5d4676 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -115,6 +115,7 @@ pub enum CommandResponse { Pong, ServerConnect { welcome_message: Option<String>, + server_state: Server, }, ServerStatus { version: u32, |
