From ef4c5548200d1f07fac33e72b48a0311b47a2071 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Fri, 17 Nov 2023 09:06:49 +0100 Subject: [PATCH] Set channel active when joining --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e659030..0fcc2ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,8 +97,10 @@ impl Cri { self .input_tx .borrow() - .send(IrcCommand::JOIN(channel, tokens.next().map(str::to_string), None).into()) - .unwrap() + .send(IrcCommand::JOIN(channel.clone(), tokens.next().map(str::to_string), None).into()) + .unwrap(); + + self.message_log.set_active(Some(channel)); }, "/part" => { let channel = tokens.next().map(str::to_string).or_else(|| self.message_log.active_channel.clone()); @@ -123,7 +125,7 @@ impl Cri { ) .into(), ) - .unwrap() + .unwrap(); } "/query" => self .message_log