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(); let mut aliases = Vec::new();
match tag.host { 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 { links.push(WebFingerRel::RelOStatusSubscribe {
rel: RelOStatusSubscribe, rel: RelOStatusSubscribe,
@ -95,15 +103,16 @@ pub async fn handle_webfinger(
}); });
aliases.push(WebFingerSubject::Url(user_url)); aliases.push(WebFingerSubject::Url(user_url));
}
}
if let Some(uri) = user.uri { links.push(WebFingerRel::RelSelf {
links.push(WebFingerRel::RelSelf { rel: RelSelf,
rel: RelSelf, content_type: ContentActivityStreams,
content_type: ContentActivityStreams, href: format!(
href: uri, "{}://{}/users/{}",
}); config.networking.protocol, config.networking.host, user.id
),
});
}
} }
Ok(( Ok((