Skip to content

change create.rs#365

Open
donjuanplatinum wants to merge 1 commit intomatrix-construct:devfrom
donjuanplatinum:create_rs
Open

change create.rs#365
donjuanplatinum wants to merge 1 commit intomatrix-construct:devfrom
donjuanplatinum:create_rs

Conversation

@donjuanplatinum
Copy link
Contributor

in the synapse room.py line 1690

        if config["guest_can_join"]:
            if (EventTypes.GuestAccess, "") not in initial_state:
                guest_access_event, guest_access_context = await create_event(
                    EventTypes.GuestAccess,
                    {EventContentFields.GUEST_ACCESS: GuestAccess.CAN_JOIN},
                    True,
                )
                events_to_send.append((guest_access_event, guest_access_context))

it says that: only guest_can_join == true, it will create and return guest_access event.

in the past tuwunel create.rs line 246 : it will create and return guest_access anyway.

	// 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?;

@jevolk jevolk requested a review from dasha-uwu March 12, 2026 08:12
@jevolk jevolk added the bug Something isn't right. label Mar 12, 2026
Copy link
Member

@dasha-uwu dasha-uwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should we do this? the spec doesn't say to. in fact it says the opposite:

It MUST apply the events implied by the request in the following order:
...
Events set by the preset. Currently these are the m.room.join_rules, m.room.history_visibility, and m.room.guest_access state events.

it doesn't say we should or just can skip the events. synapse is wrong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't right.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants