Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions src/api/client/room/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,23 @@ pub(crate) async fn create_room_route(
.await?;

// 5.3 Guest Access
services
.timeline
.build_and_append_pdu(
PduBuilder::state(
String::new(),
&RoomGuestAccessEventContent::new(match preset {
| RoomPreset::PublicChat => GuestAccess::Forbidden,
| _ => GuestAccess::CanJoin,
}),
),
sender_user,
&room_id,
&state_lock,
)
.boxed()
.await?;
// Only send for non-public presets (matching Synapse's behavior where
// guest_can_join is true for private_chat and trusted_private_chat only)
if preset != RoomPreset::PublicChat {
services
.timeline
.build_and_append_pdu(
PduBuilder::state(
String::new(),
&RoomGuestAccessEventContent::new(GuestAccess::CanJoin),
),
sender_user,
&room_id,
&state_lock,
)
.boxed()
.await?;
}

// 6. Events listed in initial_state
let mut is_encrypted = false;
Expand Down
Loading