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

@@ -117,7 +117,7 @@ impl ApObjectHandler for ThoughtsObjectHandler {
let note: ThoughtNote = serde_json::from_value(object)?;
let author_id = self
.repo
.intern_remote_actor(actor_url)
.intern_remote_actor(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))?;
@@ -140,14 +140,14 @@ impl ApObjectHandler for ThoughtsObjectHandler {
self.repo
.accept_note(
ap_id,
ap_id.as_str(),
&author_id,
&note.content,
note.published,
note.sensitive,
note.summary,
visibility,
note.in_reply_to.as_ref(),
note.in_reply_to.as_ref().map(|u| u.as_str()),
)
.await
.map_err(|e| anyhow!("{e}"))?;
@@ -198,21 +198,21 @@ impl ApObjectHandler for ThoughtsObjectHandler {
) -> Result<()> {
let note: ThoughtNote = serde_json::from_value(object)?;
self.repo
.apply_note_update(ap_id, &note.content)
.apply_note_update(ap_id.as_str(), &note.content)
.await
.map_err(|e| anyhow!("{e}"))
}
async fn on_delete(&self, ap_id: &Url, _actor_url: &Url) -> Result<()> {
self.repo
.retract_note(ap_id)
.retract_note(ap_id.as_str())
.await
.map_err(|e| anyhow!("{e}"))
}
async fn on_actor_removed(&self, actor_url: &Url) -> Result<()> {
self.repo
.retract_actor_notes(actor_url)
.retract_actor_notes(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))
}
@@ -234,7 +234,7 @@ impl ApObjectHandler for ThoughtsObjectHandler {
let actor_user_id = self
.repo
.find_remote_actor_id(actor_url)
.find_remote_actor_id(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))?;
@@ -278,7 +278,7 @@ impl ApObjectHandler for ThoughtsObjectHandler {
let actor_user_id = self
.repo
.find_remote_actor_id(actor_url)
.find_remote_actor_id(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))?;
@@ -310,7 +310,7 @@ impl ApObjectHandler for ThoughtsObjectHandler {
) -> anyhow::Result<()> {
let author_user_id = match self
.repo
.find_remote_actor_id(actor_url)
.find_remote_actor_id(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))?
{
@@ -356,7 +356,7 @@ impl ApObjectHandler for ThoughtsObjectHandler {
let actor_user_id = self
.repo
.find_remote_actor_id(actor_url)
.find_remote_actor_id(actor_url.as_str())
.await
.map_err(|e| anyhow!("{e}"))?;