1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-09-30 18:42:05 +00:00

fix: Don't perform local join when there's no remote servers

This commit is contained in:
nexy7574 2025-09-20 18:20:40 +01:00 committed by nex
parent 563b6d4b30
commit 1d80b7ce0c

View file

@ -3,7 +3,7 @@ use std::{borrow::Borrow, collections::HashMap, iter::once, sync::Arc};
use axum::extract::State; use axum::extract::State;
use axum_client_ip::InsecureClientIp; use axum_client_ip::InsecureClientIp;
use conduwuit::{ use conduwuit::{
Err, Result, debug, debug_info, debug_warn, err, error, info, Err, Error, Result, debug, debug_info, debug_warn, err, error, info,
matrix::{ matrix::{
StateKey, StateKey,
event::{gen_event_id, gen_event_id_canonical_json}, event::{gen_event_id, gen_event_id_canonical_json},
@ -313,11 +313,14 @@ pub async fn join_room_by_id_helper(
} }
} }
let local_join = server_in_room if !server_in_room && servers.is_empty() {
|| servers.is_empty() return Err!(Request(NotFound(
|| (servers.len() == 1 && services.globals.server_is_ours(&servers[0])); "No servers were provided to assist in joining the room remotely, and we are not \
already participating in the room."
)));
}
if local_join { if server_in_room {
join_room_by_id_helper_local( join_room_by_id_helper_local(
services, services,
sender_user, sender_user,