mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 04:06:54 +00:00
Modernize various sender_user/sender_device lets.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
d6aa03ea73
commit
49f7a2487f
20 files changed
+69
-90
No files matched your search
@@ -21,11 +21,9 @@ pub(crate) async fn get_devices_route(
|
||||
State(services): State<crate::State>,
|
||||
body: Ruma<get_devices::v3::Request>,
|
||||
) -> Result<get_devices::v3::Response> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let devices: Vec<device::Device> = services
|
||||
.users
|
||||
.all_devices_metadata(sender_user)
|
||||
.all_devices_metadata(body.sender_user())
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
@@ -39,11 +37,9 @@ pub(crate) async fn get_device_route(
|
||||
State(services): State<crate::State>,
|
||||
body: Ruma<get_device::v3::Request>,
|
||||
) -> Result<get_device::v3::Response> {
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
|
||||
let device = services
|
||||
.users
|
||||
.get_device_metadata(sender_user, &body.body.device_id)
|
||||
.get_device_metadata(body.sender_user(), &body.body.device_id)
|
||||
.await
|
||||
.map_err(|_| err!(Request(NotFound("Device not found."))))?;
|
||||
|
||||
|
||||
Reference in new issue
Block a user