From d104b32d5ed83154aaa4fba00b5d0d9c4ad5eac6 Mon Sep 17 00:00:00 2001 From: silverpill Date: Thu, 18 Nov 2021 16:50:42 +0000 Subject: [PATCH] Make "name" attribute optional in Attachment object --- src/activitypub/activity.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/activitypub/activity.rs b/src/activitypub/activity.rs index fac3ad9..5f0f1ff 100644 --- a/src/activitypub/activity.rs +++ b/src/activitypub/activity.rs @@ -15,7 +15,7 @@ use super::vocabulary::*; #[derive(Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct Attachment { - pub name: String, + pub name: Option, #[serde(rename = "type")] pub attachment_type: String, @@ -131,7 +131,7 @@ pub fn create_note( let url = get_file_url(instance_url, &db_item.file_name); let media_type = db_item.media_type.clone().unwrap_or("".to_string()); Attachment { - name: "".to_string(), + name: None, attachment_type: DOCUMENT.to_string(), media_type, url,