From 866d752a3c10d46aea9876e5b84727a58d09621d Mon Sep 17 00:00:00 2001 From: Nutomic Date: Wed, 8 May 2024 14:01:04 +0200 Subject: [PATCH] Instance.preferred_username should be optional (fixes #4701) (#4713) --- crates/apub/src/objects/instance.rs | 2 +- crates/apub/src/protocol/objects/instance.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/apub/src/objects/instance.rs b/crates/apub/src/objects/instance.rs index ddfeb8ca2..2f01609a6 100644 --- a/crates/apub/src/objects/instance.rs +++ b/crates/apub/src/objects/instance.rs @@ -100,7 +100,7 @@ impl Object for ApubSite { kind: ApplicationType::Application, id: self.id().into(), name: self.name.clone(), - preferred_username: data.domain().to_string(), + preferred_username: Some(data.domain().to_string()), content: self.sidebar.as_ref().map(|d| markdown_to_html(d)), source: self.sidebar.clone().map(Source::new), summary: self.description.clone(), diff --git a/crates/apub/src/protocol/objects/instance.rs b/crates/apub/src/protocol/objects/instance.rs index 8f6a0f368..1f21e76da 100644 --- a/crates/apub/src/protocol/objects/instance.rs +++ b/crates/apub/src/protocol/objects/instance.rs @@ -22,7 +22,7 @@ pub struct Instance { /// site name pub(crate) name: String, /// instance domain, necessary for mastodon authorized fetch - pub(crate) preferred_username: String, + pub(crate) preferred_username: Option, pub(crate) inbox: Url, /// mandatory field in activitypub, lemmy currently serves an empty outbox pub(crate) outbox: Url,