feat: implement remote unfollow — wire FederationActionPort through delete_follow handler
This commit is contained in:
@@ -1418,6 +1418,21 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
||||
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))
|
||||
}
|
||||
|
||||
async fn unfollow_remote(
|
||||
&self,
|
||||
local_user_id: &domain::value_objects::UserId,
|
||||
handle: &str,
|
||||
) -> Result<(), domain::errors::DomainError> {
|
||||
let data = self.federation_config.to_request_data();
|
||||
let remote_actor: DbActor = webfinger_resolve_actor(handle, &data).await.map_err(|e| {
|
||||
domain::errors::DomainError::ExternalService(anyhow::anyhow!("{e}").to_string())
|
||||
})?;
|
||||
let actor_url = remote_actor.ap_id.to_string();
|
||||
self.unfollow(local_user_id.as_uuid(), &actor_url)
|
||||
.await
|
||||
.map_err(|e| domain::errors::DomainError::ExternalService(e.to_string()))
|
||||
}
|
||||
|
||||
async fn actor_json(
|
||||
&self,
|
||||
user_id: &domain::value_objects::UserId,
|
||||
|
||||
Reference in New Issue
Block a user