diff --git a/changelog.d/+cbef004c.removal.md b/changelog.d/+cbef004c.removal.md new file mode 100644 index 000000000..e6c943de4 --- /dev/null +++ b/changelog.d/+cbef004c.removal.md @@ -0,0 +1 @@ +The deprecated `well_known.rtc_focus_server_urls` config option has been removed. MatrixRTC foci should be configured using the `matrix_rtc.foci` config option. diff --git a/conduwuit-example.toml b/conduwuit-example.toml index a1cad85e0..a9c2ba827 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -1874,16 +1874,6 @@ # #support_pgp_key = -# **DEPRECATED**: Use `[global.matrix_rtc].foci` instead. -# -# A list of MatrixRTC foci URLs which will be served as part of the -# MSC4143 client endpoint at /.well-known/matrix/client. -# -# This option is deprecated and will be removed in a future release. -# Please migrate to the new `[global.matrix_rtc]` config section. -# -#rtc_focus_server_urls = [] - [global.blurhashing] # blurhashing x component, 4 is recommended by https://blurha.sh/ diff --git a/src/api/client/well_known.rs b/src/api/client/well_known.rs index 698aa4e31..c0632955f 100644 --- a/src/api/client/well_known.rs +++ b/src/api/client/well_known.rs @@ -2,7 +2,7 @@ use axum::extract::State; use conduwuit::{Err, Result}; use ruma::{ api::client::discovery::{ - discover_homeserver::{self, HomeserverInfo, RtcFocusInfo}, + discover_homeserver::{self, HomeserverInfo}, discover_support::{self, Contact, ContactRole}, }, assign, @@ -31,10 +31,8 @@ pub(crate) async fn well_known_client( rtc_foci: services .config .matrix_rtc - .effective_foci(&services.config.well_known.rtc_focus_server_urls) - .into_iter() - .map(|focus| RtcFocusInfo::new(focus.transport_type(), focus.data().into_owned()).unwrap()) - .collect() + .foci + .clone() })) } @@ -48,10 +46,7 @@ pub(crate) async fn get_rtc_transports( _body: Ruma, ) -> Result { Ok(ruma::api::client::rtc::transports::v1::Response::new( - services - .config - .matrix_rtc - .effective_foci(&services.config.well_known.rtc_focus_server_urls), + services.config.matrix_rtc.foci.clone(), )) } diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index eb28d4dda..540618430 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -20,10 +20,7 @@ use lettre::message::Mailbox; use regex::RegexSet; use ruma::{ OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName, OwnedUserId, RoomVersionId, - api::client::{ - discovery::{discover_homeserver::RtcFocusInfo, discover_support::ContactRole}, - rtc::transports::v1::RtcTransport, - }, + api::client::{discovery::discover_support::ContactRole, rtc::RtcTransport}, }; use serde::{Deserialize, Serialize, de::IgnoredAny}; use url::Url; @@ -2197,18 +2194,6 @@ pub struct WellKnownConfig { /// PGP key URI for server support contacts, to be served as part of the /// MSC1929 server support endpoint. pub support_pgp_key: Option, - - /// **DEPRECATED**: Use `[global.matrix_rtc].foci` instead. - /// - /// A list of MatrixRTC foci URLs which will be served as part of the - /// MSC4143 client endpoint at /.well-known/matrix/client. - /// - /// This option is deprecated and will be removed in a future release. - /// Please migrate to the new `[global.matrix_rtc]` config section. - /// - /// default: [] - #[serde(default)] - pub rtc_focus_server_urls: Vec, } #[derive(Clone, Copy, Debug, Deserialize, Default)] @@ -2257,25 +2242,6 @@ pub struct MatrixRtcConfig { pub foci: Vec, } -impl MatrixRtcConfig { - /// Returns the effective foci, falling back to the deprecated - /// `rtc_focus_server_urls` if the new config is empty. - #[must_use] - pub fn effective_foci(&self, deprecated_foci: &[RtcFocusInfo]) -> Vec { - if !self.foci.is_empty() { - self.foci.clone() - } else { - deprecated_foci - .iter() - .map(|focus| { - RtcTransport::new(focus.focus_type().to_owned(), focus.data().into_owned()) - .unwrap() - }) - .collect() - } - } -} - #[derive(Deserialize, Clone, Debug)] #[serde(transparent)] struct ListeningPort {