Write message to log if remote actor has aliases
This commit is contained in:
parent
01305475c3
commit
8f7dd5d88c
2 changed files with 10 additions and 0 deletions
|
@ -109,6 +109,9 @@ pub struct Actor {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub summary: Option<String>,
|
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")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub attachment: Option<Vec<ActorAttachment>>,
|
pub attachment: Option<Vec<ActorAttachment>>,
|
||||||
|
|
||||||
|
@ -295,6 +298,7 @@ pub fn get_local_actor(
|
||||||
icon: avatar,
|
icon: avatar,
|
||||||
image: banner,
|
image: banner,
|
||||||
summary: user.profile.bio.clone(),
|
summary: user.profile.bio.clone(),
|
||||||
|
also_known_as: None,
|
||||||
attachment: Some(attachments),
|
attachment: Some(attachments),
|
||||||
url: Some(actor_id),
|
url: Some(actor_id),
|
||||||
};
|
};
|
||||||
|
@ -331,6 +335,7 @@ pub fn get_instance_actor(
|
||||||
icon: None,
|
icon: None,
|
||||||
image: None,
|
image: None,
|
||||||
summary: None,
|
summary: None,
|
||||||
|
also_known_as: None,
|
||||||
attachment: None,
|
attachment: None,
|
||||||
url: None,
|
url: None,
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,6 +69,11 @@ async fn create_remote_profile(
|
||||||
if actor_address.is_local(&instance.host()) {
|
if actor_address.is_local(&instance.host()) {
|
||||||
return Err(ImportError::LocalObject);
|
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(
|
let (maybe_avatar, maybe_banner) = fetch_actor_images(
|
||||||
instance,
|
instance,
|
||||||
&actor,
|
&actor,
|
||||||
|
|
Loading…
Reference in a new issue