mirror of
https://github.com/astro/buzzrelay.git
synced 2024-11-22 04:00:59 +00:00
actor: add a sharedInbox field
This commit is contained in:
parent
2db06d8e89
commit
70f66cbda3
2 changed files with 10 additions and 0 deletions
|
@ -12,12 +12,19 @@ pub struct Actor {
|
||||||
pub icon: Option<Media>,
|
pub icon: Option<Media>,
|
||||||
pub inbox: String,
|
pub inbox: String,
|
||||||
pub outbox: Option<String>,
|
pub outbox: Option<String>,
|
||||||
|
pub endpoints: Option<ActorEndpoints>,
|
||||||
#[serde(rename = "publicKey")]
|
#[serde(rename = "publicKey")]
|
||||||
pub public_key: ActorPublicKey,
|
pub public_key: ActorPublicKey,
|
||||||
#[serde(rename = "preferredUsername")]
|
#[serde(rename = "preferredUsername")]
|
||||||
pub preferred_username: Option<String>,
|
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)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct ActorPublicKey {
|
pub struct ActorPublicKey {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
|
|
|
@ -56,6 +56,9 @@ impl Actor {
|
||||||
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
|
url: "https://fedi.buzz/assets/favicon48.png".to_string(),
|
||||||
}),
|
}),
|
||||||
inbox: self.uri(),
|
inbox: self.uri(),
|
||||||
|
endpoints: Some(activitypub::ActorEndpoints {
|
||||||
|
shared_inbox: format!("https://{}/instance/{}", self.host, self.host),
|
||||||
|
}),
|
||||||
outbox: Some(format!("{}/outbox", self.uri())),
|
outbox: Some(format!("{}/outbox", self.uri())),
|
||||||
public_key: activitypub::ActorPublicKey {
|
public_key: activitypub::ActorPublicKey {
|
||||||
id: self.key_id(),
|
id: self.key_id(),
|
||||||
|
|
Loading…
Reference in a new issue