feat: v2 rewrite — hexagonal arch, ActivityPub federation, NATS, deployment-ready #1
@@ -1382,9 +1382,12 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
|||||||
domain::errors::DomainError::ExternalService(e.to_string())
|
domain::errors::DomainError::ExternalService(e.to_string())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
let domain_str = actor.ap_id.host_str().unwrap_or("");
|
||||||
|
let full_handle = format!("{}@{}", actor.username, domain_str);
|
||||||
|
|
||||||
Ok(domain::models::remote_actor::RemoteActor {
|
Ok(domain::models::remote_actor::RemoteActor {
|
||||||
url: actor.ap_id.to_string(),
|
url: actor.ap_id.to_string(),
|
||||||
handle: actor.username.clone(),
|
handle: full_handle,
|
||||||
display_name: Some(actor.username.clone()),
|
display_name: Some(actor.username.clone()),
|
||||||
inbox_url: actor.inbox_url.to_string(),
|
inbox_url: actor.inbox_url.to_string(),
|
||||||
shared_inbox_url: None,
|
shared_inbox_url: None,
|
||||||
@@ -1403,6 +1406,15 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))
|
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn actor_json(
|
||||||
|
&self,
|
||||||
|
user_id: &domain::value_objects::UserId,
|
||||||
|
) -> Result<String, domain::errors::DomainError> {
|
||||||
|
ActivityPubService::actor_json(self, &user_id.as_uuid().to_string())
|
||||||
|
.await
|
||||||
|
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user