From f44df38ea174065ed53525d95c7cf50e548bfe58 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 23 Mar 2020 11:00:12 -0500 Subject: [PATCH] Revert "Do not prefer sharedinbox" This reverts commit 3389730242461d73c0a56fb32211f66a6ed0af47. --- src/apub.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/apub.rs b/src/apub.rs index 7b1367a..0f019c6 100644 --- a/src/apub.rs +++ b/src/apub.rs @@ -81,9 +81,17 @@ pub struct AcceptedActors { pub inbox: XsdAnyUri, + pub endpoints: Endpoints, + pub public_key: PublicKey, } +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] +#[serde(rename_all = "camelCase")] +pub struct Endpoints { + shared_inbox: Option, +} + impl PublicKey { pub fn to_ext(self) -> PublicKeyExtension { self.into() @@ -174,6 +182,6 @@ impl ValidObjects { impl AcceptedActors { pub fn inbox(&self) -> &XsdAnyUri { - &self.inbox + self.endpoints.shared_inbox.as_ref().unwrap_or(&self.inbox) } }