feat(domain): add federation management methods to FederationActionPort
This commit is contained in:
@@ -1769,6 +1769,51 @@ impl domain::ports::FederationActionPort for ActivityPubService {
|
|||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn get_pending_followers(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn accept_follow_request(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), domain::errors::DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn reject_follow_request(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), domain::errors::DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_remote_followers(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn remove_remote_follower(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), domain::errors::DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_remote_following(
|
||||||
|
&self,
|
||||||
|
_user_id: &domain::value_objects::UserId,
|
||||||
|
) -> Result<Vec<domain::models::remote_actor::RemoteActor>, domain::errors::DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -228,6 +228,29 @@ pub trait FederationActionPort: Send + Sync {
|
|||||||
local_user_id: &UserId,
|
local_user_id: &UserId,
|
||||||
handle: &str,
|
handle: &str,
|
||||||
) -> Result<(), DomainError>;
|
) -> Result<(), DomainError>;
|
||||||
|
async fn get_pending_followers(
|
||||||
|
&self,
|
||||||
|
user_id: &UserId,
|
||||||
|
) -> Result<Vec<RemoteActor>, DomainError>;
|
||||||
|
async fn accept_follow_request(
|
||||||
|
&self,
|
||||||
|
user_id: &UserId,
|
||||||
|
actor_url: &str,
|
||||||
|
) -> Result<(), DomainError>;
|
||||||
|
async fn reject_follow_request(
|
||||||
|
&self,
|
||||||
|
user_id: &UserId,
|
||||||
|
actor_url: &str,
|
||||||
|
) -> Result<(), DomainError>;
|
||||||
|
async fn get_remote_followers(&self, user_id: &UserId)
|
||||||
|
-> Result<Vec<RemoteActor>, DomainError>;
|
||||||
|
async fn remove_remote_follower(
|
||||||
|
&self,
|
||||||
|
user_id: &UserId,
|
||||||
|
actor_url: &str,
|
||||||
|
) -> Result<(), DomainError>;
|
||||||
|
async fn get_remote_following(&self, user_id: &UserId)
|
||||||
|
-> Result<Vec<RemoteActor>, DomainError>;
|
||||||
async fn actor_json(&self, user_id: &UserId) -> Result<String, DomainError>;
|
async fn actor_json(&self, user_id: &UserId) -> Result<String, DomainError>;
|
||||||
async fn followers_collection_json(
|
async fn followers_collection_json(
|
||||||
&self,
|
&self,
|
||||||
|
|||||||
@@ -556,6 +556,51 @@ impl FederationActionPort for TestStore {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn get_pending_followers(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
) -> Result<Vec<RemoteActor>, DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn accept_follow_request(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn reject_follow_request(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_remote_followers(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
) -> Result<Vec<RemoteActor>, DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn remove_remote_follower(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
_actor_url: &str,
|
||||||
|
) -> Result<(), DomainError> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn get_remote_following(
|
||||||
|
&self,
|
||||||
|
_user_id: &UserId,
|
||||||
|
) -> Result<Vec<RemoteActor>, DomainError> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
|
||||||
async fn actor_json(&self, _user_id: &UserId) -> Result<String, DomainError> {
|
async fn actor_json(&self, _user_id: &UserId) -> Result<String, DomainError> {
|
||||||
Err(DomainError::NotFound)
|
Err(DomainError::NotFound)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user