Write message to log if remote actor has aliases

This commit is contained in:
silverpill 2022-10-21 21:32:01 +00:00
parent 01305475c3
commit 8f7dd5d88c
2 changed files with 10 additions and 0 deletions

View file

@ -109,6 +109,9 @@ pub struct Actor {
#[serde(skip_serializing_if = "Option::is_none")]
pub summary: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub also_known_as: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attachment: Option<Vec<ActorAttachment>>,
@ -295,6 +298,7 @@ pub fn get_local_actor(
icon: avatar,
image: banner,
summary: user.profile.bio.clone(),
also_known_as: None,
attachment: Some(attachments),
url: Some(actor_id),
};
@ -331,6 +335,7 @@ pub fn get_instance_actor(
icon: None,
image: None,
summary: None,
also_known_as: None,
attachment: None,
url: None,
};

View file

@ -69,6 +69,11 @@ async fn create_remote_profile(
if actor_address.is_local(&instance.host()) {
return Err(ImportError::LocalObject);
};
let maybe_also_known_as = actor.also_known_as.as_ref()
.and_then(|aliases| aliases.first());
if let Some(ref also_known_as) = maybe_also_known_as {
log::warn!("actor also known as {}", also_known_as);
};
let (maybe_avatar, maybe_banner) = fetch_actor_images(
instance,
&actor,