aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 59f84fa..061dbc2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -126,6 +126,9 @@ fn handle_input(text: &str, app: &mut AppState, client: &mut Client) -> bool {
match verb.as_str() {
"JOIN" => {
+ if !app.channel.is_empty() {
+ client.part(&app.channel, None);
+ }
client.join(args.trim());
app.channel = args.trim().to_string();
}