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:
@@ -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