fix: make ThoughtNote url field optional for AP compat

This commit is contained in:
2026-05-17 11:57:10 +02:00
parent 7dcdbb4551
commit 2c34eb44e4

View File

@@ -11,7 +11,8 @@ pub struct ThoughtNote {
#[serde(rename = "type")] #[serde(rename = "type")]
pub kind: NoteType, pub kind: NoteType,
pub id: Url, pub id: Url,
pub url: Url, // Mastodon uses this as the clickable link #[serde(skip_serializing_if = "Option::is_none", default)]
pub url: Option<Url>,
pub attributed_to: Url, pub attributed_to: Url,
pub content: String, pub content: String,
pub published: DateTime<Utc>, pub published: DateTime<Utc>,
@@ -42,7 +43,7 @@ impl ThoughtNote {
) -> Self { ) -> Self {
Self { Self {
kind: Default::default(), kind: Default::default(),
url: id.clone(), url: Some(id.clone()),
id, id,
attributed_to: actor_url, attributed_to: actor_url,
content, content,