Set channel active when joining

This commit is contained in:
Sijmen 2023-11-17 09:06:49 +01:00
parent 6209393cd0
commit ef4c554820
Signed by: vijfhoek
GPG key ID: DAF7821E067D9C48

View file

@ -97,8 +97,10 @@ impl Cri {
self self
.input_tx .input_tx
.borrow() .borrow()
.send(IrcCommand::JOIN(channel, tokens.next().map(str::to_string), None).into()) .send(IrcCommand::JOIN(channel.clone(), tokens.next().map(str::to_string), None).into())
.unwrap() .unwrap();
self.message_log.set_active(Some(channel));
}, },
"/part" => { "/part" => {
let channel = tokens.next().map(str::to_string).or_else(|| self.message_log.active_channel.clone()); let channel = tokens.next().map(str::to_string).or_else(|| self.message_log.active_channel.clone());
@ -123,7 +125,7 @@ impl Cri {
) )
.into(), .into(),
) )
.unwrap() .unwrap();
} }
"/query" => self "/query" => self
.message_log .message_log