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:
parent
c19f26f4fa
commit
7d1637a2f0
1 changed files with 5 additions and 0 deletions
|
|
@ -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 {
|
if let Err(e) = state.borrow_mut().send_raw(&format!("JOIN {ch}")).await {
|
||||||
warn!("irc: failed to join {ch}: {e}");
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue