Compare commits

..

No commits in common. "538de5e849e0f89b7b853eb36401a0b99cbc7703" and "cb5651c528f24b2ea33367f5a1adf5d38c5c1428" have entirely different histories.

1 changed files with 15 additions and 23 deletions

View File

@ -893,33 +893,25 @@ async fn handle_join(
) -> Result<()> { ) -> Result<()> {
match chan { match chan {
Chan::Global(chan_name) => { Chan::Global(chan_name) => {
let room_id = RoomId::from(chan_name.clone())?; let room_id = RoomId::try_from(chan_name.clone())?;
match user_handle.join_room(room_id).await? { if let JoinResult::Success(room_info) = user_handle.join_room(room_id).await? {
JoinResult::Success(room_info) => { produce_on_join_cmd_messages(&config, &user, chan, &room_info, writer).await?;
produce_on_join_cmd_messages(&config, &user, chan, &room_info, writer).await?; } else {
} ServerMessage {
JoinResult::AlreadyJoined => { tags: vec![],
// we do nothing on repeated joins sender: Some(config.server_name.clone()),
} body: ServerMessageBody::N474BannedFromChan {
JoinResult::Banned => { client: user.nickname.clone(),
ServerMessage { chan: chan.clone(),
tags: vec![], message: "U dun goofed".into(),
sender: Some(config.server_name.clone()), },
body: ServerMessageBody::N474BannedFromChan {
client: user.nickname.clone(),
chan: chan.clone(),
message: "U dun goofed".into(),
},
}
.write_async(writer)
.await?;
} }
.write_async(writer)
.await?;
} }
writer.flush().await?; writer.flush().await?;
} }
Chan::Local(_) => { Chan::Local(_) => {}
// TODO handle join attempts to local chans with an error, we don't support these
}
}; };
Ok(()) Ok(())
} }