1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-17 14:00:50 +01:00

fix: restricted room error is now FORBIDDEN

This commit is contained in:
Timo Kösters 2023-06-08 20:48:35 +02:00
parent 422ee40107
commit 1ea27c4f97
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB

View file

@ -106,6 +106,7 @@ pub async fn join_room_by_id_or_alias_route(
); );
servers.push(room_id.server_name().to_owned()); servers.push(room_id.server_name().to_owned());
(servers, room_id) (servers, room_id)
} }
Err(room_alias) => { Err(room_alias) => {
@ -598,7 +599,7 @@ async fn join_room_by_id_helper(
info!("send_join finished"); info!("send_join finished");
if let Some(signed_raw) = &send_join_response.room_state.event { if let Some(signed_raw) = &send_join_response.room_state.event {
info!("There is a signed event. This room is probably using restricted joins"); info!("There is a signed event. This room is probably using restricted joins. Adding signature to our event");
let (signed_event_id, signed_value) = let (signed_event_id, signed_value) =
match gen_event_id_canonical_json(signed_raw, &room_version_id) { match gen_event_id_canonical_json(signed_raw, &room_version_id) {
Ok(t) => t, Ok(t) => t,
@ -901,7 +902,13 @@ async fn join_room_by_id_helper(
Err(e) => e, Err(e) => e,
}; };
if !restriction_rooms.is_empty() { if !restriction_rooms.is_empty()
&& servers
.iter()
.filter(|s| *s != services().globals.server_name())
.count()
> 0
{
info!( info!(
"We couldn't do the join locally, maybe federation can help to satisfy the restricted join requirements" "We couldn't do the join locally, maybe federation can help to satisfy the restricted join requirements"
); );