actor: add a sharedInbox field

This commit is contained in:
Astro 2023-10-30 01:21:30 +01:00
parent 2db06d8e89
commit 70f66cbda3
2 changed files with 10 additions and 0 deletions

View file

@ -12,12 +12,19 @@ pub struct Actor {
pub icon: Option<Media>,
pub inbox: String,
pub outbox: Option<String>,
pub endpoints: Option<ActorEndpoints>,
#[serde(rename = "publicKey")]
pub public_key: ActorPublicKey,
#[serde(rename = "preferredUsername")]
pub preferred_username: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActorEndpoints {
#[serde(rename = "sharedInbox")]
pub shared_inbox: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ActorPublicKey {
pub id: String,

View file

@ -56,6 +56,9 @@ impl Actor {
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
}),
inbox: self.uri(),
endpoints: Some(activitypub::ActorEndpoints {
shared_inbox: format!("https://{}/instance/{}", self.host, self.host),
}),
outbox: Some(format!("{}/outbox", self.uri())),
public_key: activitypub::ActorPublicKey {
id: self.key_id(),