Bump Ruma for device type optimizations.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -7,7 +7,7 @@ use ruma::{
|
||||
self, delete_device, delete_devices, get_device, get_devices, update_device,
|
||||
},
|
||||
};
|
||||
use tuwunel_core::{Err, Result, debug, err, utils};
|
||||
use tuwunel_core::{Err, Result, debug, err, utils, utils::string::to_small_string};
|
||||
|
||||
use crate::{Ruma, client::DEVICE_ID_LENGTH, router::auth_uiaa};
|
||||
|
||||
@@ -66,7 +66,7 @@ pub(crate) async fn update_device_route(
|
||||
|
||||
device
|
||||
.last_seen_ip
|
||||
.clone_from(&Some(client.to_string()));
|
||||
.clone_from(&Some(to_small_string(client)));
|
||||
|
||||
device
|
||||
.last_seen_ts
|
||||
|
||||
@@ -571,7 +571,7 @@ fn add_unsigned_device_display_name(
|
||||
.or_insert_with(|| CanonicalJsonObject::default().into())
|
||||
{
|
||||
let display_name = if include_display_names {
|
||||
CanonicalJsonValue::String(display_name)
|
||||
CanonicalJsonValue::String(display_name.to_string())
|
||||
} else {
|
||||
CanonicalJsonValue::String(metadata.device_id.into())
|
||||
};
|
||||
|
||||
@@ -58,7 +58,7 @@ pub(crate) async fn get_devices_route(
|
||||
.allow_device_name_federation
|
||||
.then_some(display_name)
|
||||
.flatten()
|
||||
.or_else(|| Some(device_id.as_str().to_owned()));
|
||||
.or_else(|| Some(device_id.as_str().into()));
|
||||
|
||||
services
|
||||
.users
|
||||
|
||||
@@ -43,8 +43,8 @@ pub async fn create_device(
|
||||
let notify = true;
|
||||
self.put_device_metadata(user_id, notify, &Device {
|
||||
device_id: device_id.into(),
|
||||
display_name: initial_device_display_name,
|
||||
last_seen_ip: client_ip,
|
||||
display_name: initial_device_display_name.map(Into::into),
|
||||
last_seen_ip: client_ip.map(Into::into),
|
||||
last_seen_ts: Some(MilliSecondsSinceUnixEpoch::now()),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user