forked from lavina/lavina
irc: handle repeated joins correctly
This commit is contained in:
parent
580923814b
commit
bce8b332d2
|
@ -894,9 +894,14 @@ async fn handle_join(
|
||||||
match chan {
|
match chan {
|
||||||
Chan::Global(chan_name) => {
|
Chan::Global(chan_name) => {
|
||||||
let room_id = RoomId::from(chan_name.clone())?;
|
let room_id = RoomId::from(chan_name.clone())?;
|
||||||
if let JoinResult::Success(room_info) = user_handle.join_room(room_id).await? {
|
match 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 {
|
}
|
||||||
|
JoinResult::AlreadyJoined => {
|
||||||
|
// we do nothing on repeated joins
|
||||||
|
}
|
||||||
|
JoinResult::Banned => {
|
||||||
ServerMessage {
|
ServerMessage {
|
||||||
tags: vec![],
|
tags: vec![],
|
||||||
sender: Some(config.server_name.clone()),
|
sender: Some(config.server_name.clone()),
|
||||||
|
@ -909,9 +914,12 @@ async fn handle_join(
|
||||||
.write_async(writer)
|
.write_async(writer)
|
||||||
.await?;
|
.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(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue