irc: create channel log entries on JOIN

Channels now appear in list() immediately after joining,
not only after the first message arrives.

Co-Developed-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-04-03 20:09:06 -04:00
parent c19f26f4fa
commit 7d1637a2f0

View file

@ -408,6 +408,11 @@ async fn register_and_read<R: tokio::io::AsyncRead + Unpin>(
if let Err(e) = state.borrow_mut().send_raw(&format!("JOIN {ch}")).await {
warn!("irc: failed to join {ch}: {e}");
}
// Create log entry so channel appears in list()
let key = format!("irc.{ch}");
state.borrow_mut().channel_logs
.entry(key)
.or_insert_with(ChannelLog::new);
}
}