mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in web/
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use askama::{Template, filters::HtmlSafe};
|
use askama::{Template, filters::HtmlSafe};
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
use conduwuit_core::result::FlatOk;
|
use conduwuit_core::result::FlatOk;
|
||||||
use conduwuit_service::Services;
|
use conduwuit_service::{Services, media::mxc::Mxc};
|
||||||
use ruma::UserId;
|
use ruma::UserId;
|
||||||
|
|
||||||
pub(super) mod form;
|
pub(super) mod form;
|
||||||
@@ -36,8 +36,12 @@ impl<'a> UserCard<'a> {
|
|||||||
|
|
||||||
let avatar_src = async {
|
let avatar_src = async {
|
||||||
let avatar_url = services.users.avatar_url(user_id).await.ok()?;
|
let avatar_url = services.users.avatar_url(user_id).await.ok()?;
|
||||||
let avatar_mxc = avatar_url.parts().ok()?;
|
let (server_name, media_id) = avatar_url.parts().ok()?;
|
||||||
let file = services.media.get(&avatar_mxc).await.flat_ok()?;
|
let file = services
|
||||||
|
.media
|
||||||
|
.get(&Mxc { media_id, server_name })
|
||||||
|
.await
|
||||||
|
.flat_ok()?;
|
||||||
|
|
||||||
Some(format!(
|
Some(format!(
|
||||||
"data:{};base64,{}",
|
"data:{};base64,{}",
|
||||||
|
|||||||
Reference in New Issue
Block a user