Skip to main contentModule create
Source use std::collections::BTreeMap; π use axum::extract::State; π use futures::FutureExt; π use futures::StreamExt; π use itertools::Itertools; π use ruma::CanonicalJsonObject; π use ruma::CanonicalJsonValue; π use ruma::EventEncryptionAlgorithm; π use ruma::Int; π use ruma::OwnedRoomAliasId; π use ruma::OwnedRoomId; π use ruma::OwnedUserId; π use ruma::RoomAliasId; π use ruma::RoomId; π use ruma::RoomVersionId; π use ruma::UserId; π use ruma::api::client::room; π use ruma::api::client::room::create_room; π use ruma::api::client::room::create_room::RoomPowerLevelsContentOverride; π use ruma::api::client::room::create_room::v3::CreationContent; π use ruma::api::client::room::create_room::v3::RoomPreset; π use ruma::events::StateEventType; π use ruma::events::TimelineEventType; π use ruma::events::ignored_user_list::IgnoredUserListEventContent; π use ruma::events::room::canonical_alias::RoomCanonicalAliasEventContent; π use ruma::events::room::create::PreviousRoom; π use ruma::events::room::create::RoomCreateEventContent; π use ruma::events::room::encryption::RoomEncryptionEventContent; π use ruma::events::room::guest_access::GuestAccess; π use ruma::events::room::guest_access::RoomGuestAccessEventContent; π use ruma::events::room::history_visibility::HistoryVisibility; π use ruma::events::room::history_visibility::RoomHistoryVisibilityEventContent; π use ruma::events::room::join_rules::JoinRule; π use ruma::events::room::join_rules::RoomJoinRulesEventContent; π use ruma::events::room::member::MembershipState; π use ruma::events::room::member::RoomMemberEventContent; π use ruma::events::room::name::RoomNameEventContent; π use ruma::events::room::power_levels::RoomPowerLevelsEventContent; π use ruma::events::room::topic::RoomTopicEventContent; π use ruma::int; π use ruma::room_version_rules::RoomIdFormatVersion; π use ruma::room_version_rules::RoomVersionRules; π use ruma::serde::JsonObject; π use ruma::serde::Raw; π use serde::Deserialize; π use serde::Deserialize; π use serde_json::Value as JsonValue; π use serde_json::json; π use serde_json::value::RawValue as RawJsonValue; π use serde_json::value::to_raw_value; π use tuwunel_core::Err; π use tuwunel_core::Error; π use tuwunel_core::Result; π use tuwunel_core::debug_info; π use tuwunel_core::debug_warn; π use tuwunel_core::err; π use tuwunel_core::info; π use tuwunel_core::info; π use tuwunel_core::utils::BoolExt; π use tuwunel_core::utils::IterStream; π use tuwunel_core::utils::ReadyExt; π use tuwunel_core::utils::json::serialized_len; π use tuwunel_core::utils::option::OptionExt; π use tuwunel_core::utils::result::FlatOk; π use tuwunel_core::warn; π use tuwunel_matrix::StateKey; π use tuwunel_matrix::pdu::Content; π use tuwunel_matrix::pdu::PduBuilder; π use tuwunel_matrix::room_version; π use tuwunel_service::Services; π use tuwunel_service::appservice::RegistrationInfo; π use tuwunel_service::profile::check_member_content; π use tuwunel_service::rooms::state::RoomMutexGuard; π use crate::Ruma; π use crate::utils::invite_check; π
- InitialEvent π
- apply_canonical_alias_pdu π
- apply_creator_join_pdu π
- apply_initial_state_pdus π
- apply_name_and_topic_pdus π
- apply_power_levels_pdu π
- apply_preset_state_pdus π
- build_power_levels_users π
- can_create_room_check π
- can_publish_directory_check π
- check_initial_member_content π
- copy_creator_predecessor_push_rule π
- create_create_event π
- create_create_event_legacy π
- create_room_route π
- custom_room_id_check π
- if a room is being created with a custom room ID, run our checks against it
- default_power_levels_content π
- creates the power_levels_content for the PDU builder
- encrypts_room π
- Whether
initial_state already configures the roomβs encryption. - expected_room_id_check π
- finalize_alias_and_directory π
- guest_access_pdu π
- invite_allowed π
- Gate an invitee against the senderβs own ignore list.
- is_empty_content π
- merge_power_level_content_override π
- Replace each top-level power-levels key wholesale; no deep merge.
- parse_initial_state π
- process_invites π
- room_alias_check π
- if a room is being created with a room alias, run our checks
- take_initial π