mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Remove deprecated MatrixRTC focus config option
This commit is contained in:
@@ -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.
|
||||||
@@ -1874,16 +1874,6 @@
|
|||||||
#
|
#
|
||||||
#support_pgp_key =
|
#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]
|
[global.blurhashing]
|
||||||
|
|
||||||
# blurhashing x component, 4 is recommended by https://blurha.sh/
|
# blurhashing x component, 4 is recommended by https://blurha.sh/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use axum::extract::State;
|
|||||||
use conduwuit::{Err, Result};
|
use conduwuit::{Err, Result};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::discovery::{
|
api::client::discovery::{
|
||||||
discover_homeserver::{self, HomeserverInfo, RtcFocusInfo},
|
discover_homeserver::{self, HomeserverInfo},
|
||||||
discover_support::{self, Contact, ContactRole},
|
discover_support::{self, Contact, ContactRole},
|
||||||
},
|
},
|
||||||
assign,
|
assign,
|
||||||
@@ -31,10 +31,8 @@ pub(crate) async fn well_known_client(
|
|||||||
rtc_foci: services
|
rtc_foci: services
|
||||||
.config
|
.config
|
||||||
.matrix_rtc
|
.matrix_rtc
|
||||||
.effective_foci(&services.config.well_known.rtc_focus_server_urls)
|
.foci
|
||||||
.into_iter()
|
.clone()
|
||||||
.map(|focus| RtcFocusInfo::new(focus.transport_type(), focus.data().into_owned()).unwrap())
|
|
||||||
.collect()
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,10 +46,7 @@ pub(crate) async fn get_rtc_transports(
|
|||||||
_body: Ruma<ruma::api::client::rtc::transports::v1::Request>,
|
_body: Ruma<ruma::api::client::rtc::transports::v1::Request>,
|
||||||
) -> Result<ruma::api::client::rtc::transports::v1::Response> {
|
) -> Result<ruma::api::client::rtc::transports::v1::Response> {
|
||||||
Ok(ruma::api::client::rtc::transports::v1::Response::new(
|
Ok(ruma::api::client::rtc::transports::v1::Response::new(
|
||||||
services
|
services.config.matrix_rtc.foci.clone(),
|
||||||
.config
|
|
||||||
.matrix_rtc
|
|
||||||
.effective_foci(&services.config.well_known.rtc_focus_server_urls),
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-35
@@ -20,10 +20,7 @@ use lettre::message::Mailbox;
|
|||||||
use regex::RegexSet;
|
use regex::RegexSet;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName, OwnedUserId, RoomVersionId,
|
OwnedRoomId, OwnedRoomOrAliasId, OwnedServerName, OwnedUserId, RoomVersionId,
|
||||||
api::client::{
|
api::client::{discovery::discover_support::ContactRole, rtc::RtcTransport},
|
||||||
discovery::{discover_homeserver::RtcFocusInfo, discover_support::ContactRole},
|
|
||||||
rtc::transports::v1::RtcTransport,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use serde::{Deserialize, Serialize, de::IgnoredAny};
|
use serde::{Deserialize, Serialize, de::IgnoredAny};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
@@ -2197,18 +2194,6 @@ pub struct WellKnownConfig {
|
|||||||
/// PGP key URI for server support contacts, to be served as part of the
|
/// PGP key URI for server support contacts, to be served as part of the
|
||||||
/// MSC1929 server support endpoint.
|
/// MSC1929 server support endpoint.
|
||||||
pub support_pgp_key: Option<String>,
|
pub support_pgp_key: Option<String>,
|
||||||
|
|
||||||
/// **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<RtcFocusInfo>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Deserialize, Default)]
|
#[derive(Clone, Copy, Debug, Deserialize, Default)]
|
||||||
@@ -2257,25 +2242,6 @@ pub struct MatrixRtcConfig {
|
|||||||
pub foci: Vec<RtcTransport>,
|
pub foci: Vec<RtcTransport>,
|
||||||
}
|
}
|
||||||
|
|
||||||
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<RtcTransport> {
|
|
||||||
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)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
struct ListeningPort {
|
struct ListeningPort {
|
||||||
|
|||||||
Reference in New Issue
Block a user