Attach icon field to User activity only whene it has avatar
This commit is contained in:
parent
113722e4ba
commit
34c374de1a
@ -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)?;
|
||||||
|
|
||||||
|
if let Some(avatar_id) = self.avatar_id {
|
||||||
let mut avatar = Image::default();
|
let mut avatar = Image::default();
|
||||||
avatar.object_props.set_url_string(
|
avatar
|
||||||
self.avatar_id
|
.object_props
|
||||||
.and_then(|id| Media::get(conn, id).and_then(|m| m.url()).ok())
|
.set_url_string(Media::get(conn, avatar_id)?.url()?)?;
|
||||||
.unwrap_or_default(),
|
|
||||||
)?;
|
|
||||||
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 New Issue
Block a user