feat: add outbox_url to RemoteActor, get_following_outbox_url to FederationRepository
This commit is contained in:
@@ -219,6 +219,7 @@ impl Object for DbActor {
|
||||
shared_inbox_url: None,
|
||||
display_name: json.name.clone(),
|
||||
avatar_url: json.icon.as_ref().map(|i| i.url.to_string()),
|
||||
outbox_url: Some(json.outbox.to_string()),
|
||||
};
|
||||
data.federation_repo.upsert_remote_actor(actor).await?;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ pub struct RemoteActor {
|
||||
pub shared_inbox_url: Option<String>,
|
||||
pub display_name: Option<String>,
|
||||
pub avatar_url: Option<String>,
|
||||
pub outbox_url: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -96,6 +97,11 @@ pub trait FederationRepository: Send + Sync {
|
||||
remote_actor_url: &str,
|
||||
status: FollowingStatus,
|
||||
) -> Result<()>;
|
||||
async fn get_following_outbox_url(
|
||||
&self,
|
||||
local_user_id: uuid::Uuid,
|
||||
remote_actor_url: &str,
|
||||
) -> Result<Option<String>>;
|
||||
async fn add_announce(
|
||||
&self,
|
||||
activity_id: &str,
|
||||
|
||||
@@ -173,6 +173,7 @@ impl ActivityPubService {
|
||||
shared_inbox_url: None,
|
||||
display_name: Some(remote_actor.username.clone()),
|
||||
avatar_url: None,
|
||||
outbox_url: Some(remote_actor.outbox_url.to_string()),
|
||||
};
|
||||
data.federation_repo
|
||||
.add_following(local_user_id, remote, &follow_id_str)
|
||||
@@ -867,6 +868,7 @@ impl ActivityPubService {
|
||||
shared_inbox_url: None,
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
outbox_url: None,
|
||||
},
|
||||
};
|
||||
actors.push(actor);
|
||||
@@ -928,6 +930,7 @@ impl ActivityPubService {
|
||||
shared_inbox_url: None,
|
||||
display_name: Some(target.username),
|
||||
avatar_url: None,
|
||||
outbox_url: None,
|
||||
};
|
||||
data.federation_repo
|
||||
.add_following(local_user_id, target_as_remote, &follow_id)
|
||||
|
||||
@@ -10,6 +10,7 @@ fn make_follower(inbox: &str, shared: Option<&str>) -> Follower {
|
||||
shared_inbox_url: shared.map(|s| s.to_string()),
|
||||
display_name: None,
|
||||
avatar_url: None,
|
||||
outbox_url: None,
|
||||
},
|
||||
status: FollowerStatus::Accepted,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user