mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-29 23:11:02 +00:00
Attach icon field to User activity only whene it has avatar
This commit is contained in:
parent
113722e4ba
commit
34c374de1a
1 changed files with 7 additions and 7 deletions
|
@ -775,13 +775,13 @@ impl User {
|
|||
let mut ap_signature = ApSignature::default();
|
||||
ap_signature.set_public_key_publickey(public_key)?;
|
||||
|
||||
let mut avatar = Image::default();
|
||||
avatar.object_props.set_url_string(
|
||||
self.avatar_id
|
||||
.and_then(|id| Media::get(conn, id).and_then(|m| m.url()).ok())
|
||||
.unwrap_or_default(),
|
||||
)?;
|
||||
actor.object_props.set_icon_object(avatar)?;
|
||||
if let Some(avatar_id) = self.avatar_id {
|
||||
let mut avatar = Image::default();
|
||||
avatar
|
||||
.object_props
|
||||
.set_url_string(Media::get(conn, avatar_id)?.url()?)?;
|
||||
actor.object_props.set_icon_object(avatar)?;
|
||||
}
|
||||
|
||||
Ok(CustomPerson::new(actor, ap_signature))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue