ignore potential errors when updating user profiles

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-01-14 01:24:49 -05:00 committed by June
parent 4d410d7304
commit 9ec1532580

View file

@ -127,16 +127,18 @@ pub async fn get_displayname_route(
.await?;
// Create and update our local copy of the user
services().users.create(&body.user_id, None)?;
services()
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
let _ = services().users.create(&body.user_id, None);
let _ = services()
.users
.set_displayname(&body.user_id, response.displayname.clone())?;
services()
.set_displayname(&body.user_id, response.displayname.clone());
let _ = services()
.users
.set_avatar_url(&body.user_id, response.avatar_url)?;
services()
.set_avatar_url(&body.user_id, response.avatar_url);
let _ = services()
.users
.set_blurhash(&body.user_id, response.blurhash)?;
.set_blurhash(&body.user_id, response.blurhash);
return Ok(get_display_name::v3::Response {
displayname: response.displayname,
@ -264,16 +266,18 @@ pub async fn get_avatar_url_route(
.await?;
// Create and update our local copy of the user
services().users.create(&body.user_id, None)?;
services()
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
let _ = services().users.create(&body.user_id, None);
let _ = services()
.users
.set_displayname(&body.user_id, response.displayname)?;
services()
.set_displayname(&body.user_id, response.displayname);
let _ = services()
.users
.set_avatar_url(&body.user_id, response.avatar_url.clone())?;
services()
.set_avatar_url(&body.user_id, response.avatar_url.clone());
let _ = services()
.users
.set_blurhash(&body.user_id, response.blurhash.clone())?;
.set_blurhash(&body.user_id, response.blurhash.clone());
return Ok(get_avatar_url::v3::Response {
avatar_url: response.avatar_url,
@ -311,16 +315,18 @@ pub async fn get_profile_route(
.await?;
// Create and update our local copy of the user
services().users.create(&body.user_id, None)?;
services()
// these are `let _` because it's fine if we can't find these for the user.
// also these requests are sent on room join so dead servers will make room joins annoying again
let _ = services().users.create(&body.user_id, None);
let _ = services()
.users
.set_displayname(&body.user_id, response.displayname.clone())?;
services()
.set_displayname(&body.user_id, response.displayname.clone());
let _ = services()
.users
.set_avatar_url(&body.user_id, response.avatar_url.clone())?;
services()
.set_avatar_url(&body.user_id, response.avatar_url.clone());
let _ = services()
.users
.set_blurhash(&body.user_id, response.blurhash.clone())?;
.set_blurhash(&body.user_id, response.blurhash.clone());
return Ok(get_profile::v3::Response {
displayname: response.displayname,