mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Nuke explicit references to the MSC4175 tz profile field
This commit is contained in:
@@ -1148,34 +1148,6 @@ impl Service {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the timezone of a user.
|
||||
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");
|
||||
let stable_key = (user_id, "m.tz");
|
||||
self.db
|
||||
.useridprofilekey_value
|
||||
.qry(&unstable_key)
|
||||
.or_else(|_| self.db.useridprofilekey_value.qry(&stable_key))
|
||||
.await
|
||||
.deserialized()
|
||||
}
|
||||
|
||||
/// Sets a new timezone or removes it if timezone is None.
|
||||
pub fn set_timezone(&self, user_id: &UserId, timezone: Option<String>) {
|
||||
// TODO: insert to the stable MSC4175 key when it's stable
|
||||
let key = (user_id, "us.cloke.msc4175.tz");
|
||||
|
||||
if let Some(timezone) = timezone {
|
||||
self.db.useridprofilekey_value.put_raw(key, &timezone);
|
||||
} else {
|
||||
self.db.useridprofilekey_value.del(key);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ldap"))]
|
||||
pub async fn search_ldap(&self, _user_id: &UserId) -> Result<Vec<(String, bool)>> {
|
||||
Err!(FeatureDisabled("ldap"))
|
||||
|
||||
Reference in New Issue
Block a user