bin/ircd: join only channels that start with #

This commit is contained in:
Dastan-glitch
2022-05-20 16:05:35 +00:00
parent af07641e08
commit 954c20bf22

View File

@@ -71,6 +71,10 @@ impl IrcServerConnection {
"JOIN" => {
let channels = tokens.next().ok_or(Error::MalformedPacket)?;
for chan in channels.split(',') {
if !chan.starts_with('#') {
warn!("{} is not a valid name for channel", chan);
continue
}
let join_reply = format!(":{}!anon@dark.fi JOIN {}\r\n", self.nickname, chan);
self.reply(&join_reply).await?;
if !self.configured_chans.contains_key(chan) {