feat(push): Add MSC4174 web push

This commit is contained in:
Erwan Leboucher authored and Ellis Git committed 2026-09-21 23:35:05 +00:00
1 parent dbcffe8af0
commit ed1e634579
23 files changed
+1864 -281

No files matched your search

+20
View File
@@ -2853,6 +2853,26 @@ const DEPRECATED_KEYS: &[&str] = &[
];
impl Config {
/// Get the base domain to use for user-facing URLs.
#[must_use]
pub fn get_client_domain(&self) -> Url {
self.well_known.client.clone().unwrap_or_else(|| {
let host = self.server_name.host();
format!("https://{host}")
.as_str()
.try_into()
.expect("server name should be a valid host")
})
}
/// Contact for the VAPID `sub` claim.
#[must_use]
pub fn webpush_vapid_contact(&self) -> Url {
self.get_client_domain()
.join("/_continuwuity/about")
.expect("about page is a valid path")
}
/// Pre-initialize config
pub fn load(paths: &[PathBuf]) -> Result<Figment> {
let envs = [
+2
View File
@@ -44,5 +44,7 @@ pub fn unstable_features() -> BTreeMap<String, bool> {
("org.matrix.msc4155".to_owned(), true),
// profile change propagation (https://github.com/matrix-org/matrix-spec-proposals/pull/4466)
("computer.gingershaped.msc4466".to_owned(), true),
// web push (https://github.com/matrix-org/matrix-spec-proposals/pull/4174)
("org.matrix.msc4174".to_owned(), true),
])
}