pub struct Rooms {Show 19 fields
pub federate_by_default: bool,
pub forget_forced_upon_leave: bool,
pub prune_require_forgotten: bool,
pub allow_creation: bool,
pub allow_alias_creation: bool,
pub allow_unstable_versions: bool,
pub allow_experimental_versions: bool,
pub default_version: RoomVersionId,
pub default_power_level_content_override: Option<Value>,
pub auto_deactivate_banned_room_attempts: bool,
pub forbidden_alias_names: RegexSet,
pub delete_after_leave: bool,
pub delayed_events: DelayedEvents,
pub extremities: Extremities,
pub invites: Invites,
pub joins: Joins,
pub policy_server: PolicyServer,
pub redaction: Redaction,
pub relations: Relations,
}Expand description
Room creation, versions and lifecycle
Defaults for rooms created here (version, federation, power levels), who
may create rooms and aliases, which room versions this server accepts,
and what happens when users leave. Creation defaults apply only to rooms
created after a change. The room directory is configured separately in
[global.directory.rooms].
Sub-sections:
[global.rooms.delayed_events]: events scheduled to be sent later (MSC4140).[global.rooms.extremities]: forward-extremity pruning.[global.rooms.invites]: invite restrictions and automatic acceptance.[global.rooms.joins]: server selection when joining remote rooms.[global.rooms.policy_server]: room policy servers (MSC4284).[global.rooms.redaction]: redaction, retained originals, erasure.[global.rooms.relations]: optional edit and reference bundles.
Tips:
- Startup fails when
default_versionnames a version that is not enabled. Stable versions (6 and later) always are; 3 to 5 only whileallow_unstable_versionsis on (the default). default_power_level_content_overridemust be a table, such as{ users_default = 50 }; any other value fails startup.forbidden_alias_namesentries are regular expressions. An entry that reads as a dotted name draws a startup warning; escape the dot ("a\\.b") to match it literally.
Fields§
§federate_by_default: boolSets the default m.federate property for newly created rooms when the
client does not request one.
When both this setting and federation.enable are false, we always
override the client-requested m.federate value to false. Rooms
permanently retain the setting chosen at creation, so changing this
value affects only new rooms.
reloadable: yes legacy: federate_created_rooms
forget_forced_upon_leave: boolCalls /forget on the user’s behalf whenever they leave a room.
This implements MSC4267, automatically forgetting rooms on leave.
reloadable: yes legacy: forget_forced_upon_leave
prune_require_forgotten: boolRequires local departures to be forgotten before pruning a room.
Disabling this lets prune-empty delete rooms local users left without
forgetting. Its force option bypasses this protection; local joins,
invites, and pending knocks always prevent pruning.
reloadable: yes default: true
allow_creation: boolAllows standard users to create rooms.
Appservices and admins can always create rooms.
reloadable: yes legacy: allow_room_creation
allow_alias_creation: boolAllows standard users to create room aliases.
Appservices and admins can always create room aliases.
reloadable: yes default: true legacy: allow_room_alias_creation
allow_unstable_versions: boolAllows joining or creating room versions we do not officially support.
Unstable versions may have flawed specifications or a non-conforming implementation, so correct operation is not guaranteed even when incorrect behavior is tolerable or unnoticed. We officially support versions 6 and later, with slightly experimental support for versions 3 through 5 that works in practice. Set to false to disable these unsupported versions.
reloadable: yes default: true legacy: allow_unstable_room_versions
allow_experimental_versions: boolEnables experimental room versions for developer use.
Unlike unstable versions, these may be under development, prototype specification changes, or present serious risks to server operation or database integrity. Set to true only for developer use.
reloadable: yes legacy: allow_experimental_room_versions
default_version: RoomVersionIdSelects the room version used by default when creating rooms.
The default follows the specification but may follow developer recommendations. Override it only with an understanding that doing so precludes updates to newer versions.
reloadable: yes legacy: default_room_version
default_power_level_content_override: Option<Value>Sets default power-level overrides for newly created rooms.
This uses the client /createRoom parameter’s
power_level_content_override shape and is merged before per-request
overrides, so clients can still override it per room. Only new rooms
are affected. Top-level keys replace wholesale rather than deep-merge,
matching the client parameter: users or events replaces that entire
computed default submap.
reloadable: yes default: unset config-example: { users_default = 50 } legacy: default_power_level_content_override
auto_deactivate_banned_room_attempts: boolDeactivates users who try to join banned rooms or forbidden room aliases or server names.
This includes room aliases or IDs with forbidden server names and makes the user leave all rooms; federation activity such as remote invites is ignored. It can remove the need for admin intervention when banned lists contain only toxic rooms or servers that no good-faith user would try to join. The default is false because rooms may be banned for non-moderation reasons and this performs full account deactivation.
reloadable: yes legacy: auto_deactivate_banned_room_attempts
forbidden_alias_names: RegexSetForbids room aliases and room IDs matching listed regular expressions.
Patterns can use regular expressions or simple words for containment matches, as in the example. Checks run on room alias creation and custom room ID creation, with startup warnings for existing database aliases with forbidden aliases or IDs.
reloadable: yes example: [“19dollarfortnitecards”, “b[4a]droom”, “badphrase”]
default: [] legacy: forbidden_alias_names
delete_after_leave: boolDeletes rooms after the last local user leaves.
This experimental feature is disabled by default to avoid surprises, but deployments conserving space may enable it; it may default to true in a future release. Some paths that remove the last local user do not yet invoke deletion, so a room can remain afterward.
reloadable: yes default: false legacy: delete_rooms_after_leave
delayed_events: DelayedEventsSettings for rooms delayed events.
display: section
extremities: ExtremitiesSettings for rooms extremities.
display: section
invites: InvitesSettings for rooms invites.
display: section
joins: JoinsSettings for rooms joins.
display: section
policy_server: PolicyServerSettings for rooms policy server.
display: section
redaction: RedactionSettings for rooms redaction.
display: section
relations: RelationsSettings for rooms relations.
display: section
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rooms
impl<'de> Deserialize<'de> for Rooms
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Rooms
impl RefUnwindSafe for Rooms
impl Send for Rooms
impl Sync for Rooms
impl Unpin for Rooms
impl UnsafeUnpin for Rooms
impl UnwindSafe for Rooms
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> ExpectInto for T
impl<T> ExpectInto for T
Source§impl<T> Expected for T
impl<T> Expected for T
Source§fn expected_add(self, rhs: Self) -> Selfwhere
Self: CheckedAdd + Sized,
fn expected_add(self, rhs: Self) -> Selfwhere
Self: CheckedAdd + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_sub(self, rhs: Self) -> Selfwhere
Self: CheckedSub + Sized,
fn expected_sub(self, rhs: Self) -> Selfwhere
Self: CheckedSub + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_mul(self, rhs: Self) -> Selfwhere
Self: CheckedMul + Sized,
fn expected_mul(self, rhs: Self) -> Selfwhere
Self: CheckedMul + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_div(self, rhs: Self) -> Selfwhere
Self: CheckedDiv + Sized,
fn expected_div(self, rhs: Self) -> Selfwhere
Self: CheckedDiv + Sized,
rhs with an expectation that the operation is valid. Read moreSource§fn expected_rem(self, rhs: Self) -> Selfwhere
Self: CheckedRem + Sized,
fn expected_rem(self, rhs: Self) -> Selfwhere
Self: CheckedRem + Sized,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> JsonCastable<CanonicalJsonValue> for T
impl<T> JsonCastable<Value> for T
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§impl<T> Tried for T
impl<T> Tried for T
Source§fn try_add(self, rhs: Self) -> Result<Self>where
Self: CheckedAdd + Sized,
fn try_add(self, rhs: Self) -> Result<Self>where
Self: CheckedAdd + Sized,
rhs with checked arithmetic. Read moreSource§fn try_sub(self, rhs: Self) -> Result<Self>where
Self: CheckedSub + Sized,
fn try_sub(self, rhs: Self) -> Result<Self>where
Self: CheckedSub + Sized,
rhs with checked arithmetic. Read moreSource§fn try_mul(self, rhs: Self) -> Result<Self>where
Self: CheckedMul + Sized,
fn try_mul(self, rhs: Self) -> Result<Self>where
Self: CheckedMul + Sized,
rhs with checked arithmetic. Read more