mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
feat(push): Add MSC4174 web push
This commit is contained in:
1 parent
dbcffe8af0
commit
ed1e634579
23 files changed
+1864
-281
No files matched your search
@@ -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 = [
|
||||
|
||||
@@ -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),
|
||||
])
|
||||
}
|
||||
Reference in new issue
Block a user