diff --git a/crates/adapters/activitypub/src/service.rs b/crates/adapters/activitypub/src/service.rs index 51ada90..067ca0c 100644 --- a/crates/adapters/activitypub/src/service.rs +++ b/crates/adapters/activitypub/src/service.rs @@ -209,16 +209,19 @@ async fn webfinger_resolve_actor_url(handle: &str) -> anyhow::Result { pub struct ApFederationAdapter { pub(crate) inner: Arc, pub(crate) connections_repo: Arc, + pub(crate) federation_repo: Arc, } impl ApFederationAdapter { pub fn new( inner: Arc, connections_repo: Arc, + federation_repo: Arc, ) -> Self { Self { inner, connections_repo, + federation_repo, } } @@ -807,6 +810,28 @@ impl FederationFollowRequestPort for ApFederationAdapter { .await .map_err(|e| DomainError::ExternalService(e.to_string())) } + + async fn mark_follower_accepted( + &self, + user_id: &UserId, + actor_url: &str, + ) -> Result<(), DomainError> { + self.federation_repo + .update_follower_status(user_id.as_uuid(), actor_url, k_ap::FollowerStatus::Accepted) + .await + .map_err(|e| DomainError::Internal(e.to_string())) + } + + async fn mark_follower_rejected( + &self, + user_id: &UserId, + actor_url: &str, + ) -> Result<(), DomainError> { + self.federation_repo + .remove_follower(user_id.as_uuid(), actor_url) + .await + .map_err(|e| DomainError::Internal(e.to_string())) + } } // FederationActionPort is a blanket supertrait; no explicit impl needed.