This commit is contained in:
Felix Ableitner 2024-09-30 14:51:49 +02:00
parent dc7b391313
commit ec52ac1bd6

View File

@ -92,7 +92,7 @@ async fn format_actor_url(
let local_protocol_and_hostname = context.settings().get_protocol_and_hostname(); let local_protocol_and_hostname = context.settings().get_protocol_and_hostname();
let local_hostname = &context.settings().hostname; let local_hostname = &context.settings().hostname;
let instance = Instance::read(&mut context.pool(), instance_id).await?; let instance = Instance::read(&mut context.pool(), instance_id).await?;
let url = if dbg!(&instance.domain) != dbg!(local_hostname) { let url = if &instance.domain != local_hostname {
format!( format!(
"{local_protocol_and_hostname}/{kind}/{name}@{}", "{local_protocol_and_hostname}/{kind}/{name}@{}",
instance.domain instance.domain
@ -130,13 +130,12 @@ mod tests {
), ),
) )
.await?; .await?;
dbg!(&community.actor_id);
let user = create_user("john".to_string(), None, &context).await?; let user = create_user("john".to_string(), None, &context).await?;
let post_form = PostInsertForm { let post_form = PostInsertForm {
..PostInsertForm::new("My post".to_string(), user.person.id, community.id) ..PostInsertForm::new("My post".to_string(), user.person.id, community.id)
}; };
let post = Post::create(&mut context.pool(), &post_form).await?; let post = Post::create(&mut context.pool(), &post_form).await?;
dbg!(&post.ap_id);
let tests: Vec<_> = vec![ let tests: Vec<_> = vec![
( (
"rewrite remote link", "rewrite remote link",