Fix m.tz identifier and bias to stable.
Bump Ruma; enable spec versions 1.12 and 1.15. Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
20
Cargo.lock
generated
20
Cargo.lock
generated
@@ -3680,7 +3680,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"assign",
|
||||
"js_int",
|
||||
@@ -3699,7 +3699,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-appservice-api"
|
||||
version = "0.13.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
@@ -3711,7 +3711,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-client-api"
|
||||
version = "0.21.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"assign",
|
||||
@@ -3736,7 +3736,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-common"
|
||||
version = "0.16.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"base64",
|
||||
@@ -3770,7 +3770,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-events"
|
||||
version = "0.31.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"as_variant",
|
||||
"indexmap",
|
||||
@@ -3797,7 +3797,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-federation-api"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"headers",
|
||||
@@ -3820,7 +3820,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-identifiers-validation"
|
||||
version = "0.11.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"thiserror 2.0.18",
|
||||
@@ -3829,7 +3829,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-macros"
|
||||
version = "0.16.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"proc-macro-crate",
|
||||
@@ -3844,7 +3844,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-push-gateway-api"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"js_int",
|
||||
"ruma-common",
|
||||
@@ -3856,7 +3856,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "ruma-signatures"
|
||||
version = "0.18.0"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=1311829cb73986ff8da4837e98a588860712630f#1311829cb73986ff8da4837e98a588860712630f"
|
||||
source = "git+https://github.com/matrix-construct/ruma?rev=069b3f6ee7499cdac84175946aeb9443d2578363#069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"ed25519-dalek",
|
||||
|
||||
@@ -327,7 +327,7 @@ default-features = false
|
||||
|
||||
[workspace.dependencies.ruma]
|
||||
git = "https://github.com/matrix-construct/ruma"
|
||||
rev = "1311829cb73986ff8da4837e98a588860712630f"
|
||||
rev = "069b3f6ee7499cdac84175946aeb9443d2578363"
|
||||
features = [
|
||||
"__compat",
|
||||
"appservice-api-c",
|
||||
|
||||
@@ -273,7 +273,7 @@ pub(crate) async fn get_profile_route(
|
||||
("avatar_url", response.avatar_url.map(Into::into)),
|
||||
("blurhash", response.blurhash),
|
||||
("displayname", response.displayname),
|
||||
("tz", response.tz),
|
||||
("m.tz", response.tz),
|
||||
];
|
||||
|
||||
let response = canonical_fields
|
||||
@@ -314,7 +314,7 @@ pub(crate) async fn get_profile_route(
|
||||
("avatar_url", avatar_url.map(Into::into)),
|
||||
("blurhash", blurhash),
|
||||
("displayname", displayname),
|
||||
("tz", tz),
|
||||
("m.tz", tz),
|
||||
];
|
||||
|
||||
let response = canonical_fields
|
||||
|
||||
@@ -39,6 +39,8 @@ pub(crate) async fn get_supported_versions_route(
|
||||
"v1.5".to_owned(),
|
||||
"v1.10".to_owned(), // relations recursion
|
||||
"v1.11".to_owned(), // authenticated media
|
||||
"v1.12".to_owned(), // m.tz
|
||||
"v1.15".to_owned(), // custom profile fields
|
||||
],
|
||||
unstable_features: BTreeMap::from_iter([
|
||||
("org.matrix.e2e_cross_signing".to_owned(), true),
|
||||
|
||||
@@ -186,8 +186,7 @@ pub async fn blurhash(&self, user_id: &UserId) -> Result<String> {
|
||||
/// Sets a new timezone or removes it if timezone is None.
|
||||
#[implement(super::Service)]
|
||||
pub fn set_timezone(&self, user_id: &UserId, timezone: Option<&str>) {
|
||||
// TODO: insert to the stable MSC4175 key when it's stable
|
||||
let key = (user_id, "us.cloke.msc4175.tz");
|
||||
let key = (user_id, "m.tz");
|
||||
|
||||
if let Some(timezone) = timezone {
|
||||
self.db
|
||||
@@ -201,16 +200,13 @@ pub fn set_timezone(&self, user_id: &UserId, timezone: Option<&str>) {
|
||||
/// Get the timezone of a user.
|
||||
#[implement(super::Service)]
|
||||
pub async fn timezone(&self, user_id: &UserId) -> Result<String> {
|
||||
// TODO: transparently migrate unstable key usage to the stable key once MSC4133
|
||||
// and MSC4175 are stable, likely a remove/insert in this block.
|
||||
|
||||
// first check the unstable prefix then check the stable prefix
|
||||
let unstable_key = (user_id, "us.cloke.msc4175.tz");
|
||||
//TODO: remove unstable key eventually.
|
||||
let stable_key = (user_id, "m.tz");
|
||||
let unstable_key = (user_id, "us.cloke.msc4175.tz");
|
||||
self.db
|
||||
.useridprofilekey_value
|
||||
.qry(&unstable_key)
|
||||
.or_else(|_| self.db.useridprofilekey_value.qry(&stable_key))
|
||||
.qry(&stable_key)
|
||||
.or_else(|_| self.db.useridprofilekey_value.qry(&unstable_key))
|
||||
.await
|
||||
.deserialized()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user