Made RelSelf resolve for local accounts

This commit is contained in:
Natty 2023-04-22 02:53:37 +02:00
parent 6bf7b17bab
commit 9efe935238
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 18 additions and 9 deletions

View File

@ -73,7 +73,15 @@ pub async fn handle_webfinger(
let mut aliases = Vec::new();
match tag.host {
Some(ref host) if host != &config.networking.host => {}
Some(ref host) if host != &config.networking.host => {
if let Some(uri) = user.uri {
links.push(WebFingerRel::RelSelf {
rel: RelSelf,
content_type: ContentActivityStreams,
href: uri,
});
}
}
_ => {
links.push(WebFingerRel::RelOStatusSubscribe {
rel: RelOStatusSubscribe,
@ -95,16 +103,17 @@ pub async fn handle_webfinger(
});
aliases.push(WebFingerSubject::Url(user_url));
}
}
if let Some(uri) = user.uri {
links.push(WebFingerRel::RelSelf {
rel: RelSelf,
content_type: ContentActivityStreams,
href: uri,
href: format!(
"{}://{}/users/{}",
config.networking.protocol, config.networking.host, user.id
),
});
}
}
Ok((
[(header::CONTENT_TYPE, ContentJrdJson.as_ref())],