feat(activitypub-base): impl actor_json port; return full user@domain handle from lookup
This commit is contained in:
@@ -1382,9 +1382,12 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
||||
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 {
|
||||
url: actor.ap_id.to_string(),
|
||||
handle: actor.username.clone(),
|
||||
handle: full_handle,
|
||||
display_name: Some(actor.username.clone()),
|
||||
inbox_url: actor.inbox_url.to_string(),
|
||||
shared_inbox_url: None,
|
||||
@@ -1403,6 +1406,15 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
||||
.await
|
||||
.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)]
|
||||
|
||||
Reference in New Issue
Block a user