1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-12-23 17:41:22 +00:00

Fix links to remote user profiles in edit history

This commit is contained in:
Felix Ableitner 2024-10-15 11:39:46 +02:00
parent 758dd913cc
commit d352a33c7a
2 changed files with 10 additions and 2 deletions

View file

@ -129,7 +129,7 @@ impl DbPerson {
.select(person::all_columns)
.into_boxed();
query = if let Some(domain) = domain {
let domain_pattern = format!("{}://{domain}/%", http_protocol_str());
let domain_pattern = format!("%://{domain}/%");
query
.filter(person::ap_id.ilike(domain_pattern))
.filter(person::local.eq(false))

View file

@ -43,7 +43,15 @@ fn user_title(person: &DbPerson) -> String {
}
fn user_link(person: &DbPerson) -> impl IntoView {
let creator_path = format!("/user/{}", person.username);
let creator_path = if person.local {
format!("/user/{}", person.username)
} else {
format!(
"/user/{}@{}",
person.username,
extract_domain(&person.ap_id)
)
};
view! { <a href=creator_path>{user_title(person)}</a> }
}