ignore potential errors when updating user profiles
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
4d410d7304
commit
9ec1532580
1 changed files with 27 additions and 21 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue