mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31: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();
|
let mut ap_signature = ApSignature::default();
|
||||||
ap_signature.set_public_key_publickey(public_key)?;
|
ap_signature.set_public_key_publickey(public_key)?;
|
||||||
|
|
||||||
let mut avatar = Image::default();
|
if let Some(avatar_id) = self.avatar_id {
|
||||||
avatar.object_props.set_url_string(
|
let mut avatar = Image::default();
|
||||||
self.avatar_id
|
avatar
|
||||||
.and_then(|id| Media::get(conn, id).and_then(|m| m.url()).ok())
|
.object_props
|
||||||
.unwrap_or_default(),
|
.set_url_string(Media::get(conn, avatar_id)?.url()?)?;
|
||||||
)?;
|
actor.object_props.set_icon_object(avatar)?;
|
||||||
actor.object_props.set_icon_object(avatar)?;
|
}
|
||||||
|
|
||||||
Ok(CustomPerson::new(actor, ap_signature))
|
Ok(CustomPerson::new(actor, ap_signature))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue