refactor(ports): ActivityPubRepository takes &str instead of url::Url — infra type stays in adapter

This commit is contained in:
2026-05-15 14:06:33 +02:00
parent c76894e527
commit 3f6b91c943
5 changed files with 69 additions and 85 deletions

View File

@@ -81,10 +81,9 @@ pub async fn get_remote_actor_posts(
viewer_id: Option<&UserId>,
) -> Result<Paginated<FeedEntry>, DomainError> {
let actor = federation.lookup_actor(handle).await?;
let ap_url = url::Url::parse(&actor.url).map_err(|e| DomainError::Internal(e.to_string()))?;
let author_id = match ap_repo.find_remote_actor_id(&ap_url).await? {
let author_id = match ap_repo.find_remote_actor_id(&actor.url).await? {
Some(id) => id,
None => ap_repo.intern_remote_actor(&ap_url).await?,
None => ap_repo.intern_remote_actor(&actor.url).await?,
};
let result = feed.user_feed(&author_id, &page, viewer_id).await?;
if let Some(outbox_url) = actor.outbox_url {