From 5dcdafe2070fb362cb0477ec4ce8b6068b9eb147 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 9 Jul 2024 06:09:12 +0000 Subject: [PATCH] take local join branch when remote join would fail Signed-off-by: Jason Volk --- src/api/client/membership.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/client/membership.rs b/src/api/client/membership.rs index 4b664c5b..5c56faa0 100644 --- a/src/api/client/membership.rs +++ b/src/api/client/membership.rs @@ -665,15 +665,17 @@ pub async fn join_room_by_id_helper( }); } - // Ask a remote server if we are not participating in this room - if !services() + if services() .rooms .state_cache .server_in_room(services().globals.server_name(), room_id)? + || servers.is_empty() + || (servers.len() == 1 && server_is_ours(&servers[0])) { - join_room_by_id_helper_remote(sender_user, room_id, reason, servers, third_party_signed, state_lock).await - } else { join_room_by_id_helper_local(sender_user, room_id, reason, servers, third_party_signed, state_lock).await + } else { + // Ask a remote server if we are not participating in this room + join_room_by_id_helper_remote(sender_user, room_id, reason, servers, third_party_signed, state_lock).await } }