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