mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-29 01:18:30 +00:00
Rename SynapseConfig -> SynapseHomeServerConfig
This commit is contained in:
@@ -18,8 +18,15 @@ use std::str::FromStr;
|
||||
|
||||
use pyo3::{exceptions::PyRuntimeError, prelude::*};
|
||||
|
||||
/// A Rust-side view of Synapse's Python `HomeServerConfig`.
|
||||
///
|
||||
/// This only mirrors the subset of config that the Rust handlers need, rather
|
||||
/// than the whole thing. Thanks to `#[derive(FromPyObject)]`, each field is
|
||||
/// pulled directly off the corresponding attribute of the Python `config`
|
||||
/// object, so you can populate it in one shot with
|
||||
/// `homeserver.getattr("config")?.extract()?`.
|
||||
#[derive(FromPyObject, Clone)]
|
||||
pub struct SynapseConfig {
|
||||
pub struct SynapseHomeServerConfig {
|
||||
pub room: RoomConfig,
|
||||
pub auth: AuthConfig,
|
||||
pub server: ServerConfig,
|
||||
|
||||
@@ -21,7 +21,7 @@ use pyo3::{
|
||||
Bound, PyResult, Python,
|
||||
};
|
||||
|
||||
use crate::config::SynapseConfig;
|
||||
use crate::config::SynapseHomeServerConfig;
|
||||
use crate::storage::db::python_db_pool::PythonDatabasePoolWrapper;
|
||||
use crate::storage::store::Store;
|
||||
|
||||
@@ -37,7 +37,7 @@ impl RustHandlers {
|
||||
#[new]
|
||||
#[pyo3(signature = (homeserver))]
|
||||
pub fn py_new(py: Python<'_>, homeserver: &Bound<'_, PyAny>) -> PyResult<RustHandlers> {
|
||||
let config: SynapseConfig = homeserver.getattr("config")?.extract()?;
|
||||
let config: SynapseHomeServerConfig = homeserver.getattr("config")?.extract()?;
|
||||
|
||||
// The Twisted reactor, used both to drive our Tokio runtime and to
|
||||
// marshal database work back onto the reactor thread.
|
||||
|
||||
@@ -19,7 +19,7 @@ use pyo3::prelude::*;
|
||||
use pythonize::{pythonize, PythonizeError};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::config::{RoomCreationPreset, SynapseConfig};
|
||||
use crate::config::{RoomCreationPreset, SynapseHomeServerConfig};
|
||||
use crate::deferred::create_deferred;
|
||||
use crate::storage::store::{PerUserExperimentalFeature, Store};
|
||||
|
||||
@@ -278,9 +278,11 @@ pub struct UnstableFeatureMap {
|
||||
e2ee_forced_trusted_private: bool,
|
||||
}
|
||||
|
||||
/// Convert from [`SynapseConfig`] to the global defaults for unstable features that the
|
||||
/// Convert from [`SynapseHomeServerConfig`] to the global defaults for unstable features that the
|
||||
/// server supports [`UnstableFeatureMap`]
|
||||
pub fn synapse_config_to_global_unstable_feature_map(config: &SynapseConfig) -> UnstableFeatureMap {
|
||||
pub fn synapse_config_to_global_unstable_feature_map(
|
||||
config: &SynapseHomeServerConfig,
|
||||
) -> UnstableFeatureMap {
|
||||
UnstableFeatureMap {
|
||||
msc2326: true,
|
||||
msc1756: true,
|
||||
|
||||
Reference in New Issue
Block a user