From a06414f0bd5ea5a7082061959ee03a406014559d Mon Sep 17 00:00:00 2001 From: aprilthepink Date: Sat, 4 May 2024 00:04:34 +0200 Subject: [PATCH] Refactor Note struct in post.rs to remove url and published fields --- src/objects/post.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/objects/post.rs b/src/objects/post.rs index 0f891d5..0e03e2a 100644 --- a/src/objects/post.rs +++ b/src/objects/post.rs @@ -39,8 +39,6 @@ pub struct Note { content: String, in_reply_to: Option>, tag: Vec, - url: String, - published: String, sensitive: bool, } @@ -92,7 +90,7 @@ impl Object for post::Model { local: Set(false), visibility: Set("public".to_string()), // TODO: make this use the real visibility sensitive: Set(json.sensitive.clone()), - url: Set(json.url.clone()), + url: Set(json.id.clone().to_string()), ..Default::default() }; let post = post @@ -114,10 +112,8 @@ impl Object for post::Model { let id: ObjectId = generate_object_id(data.domain())?.into(); let note = Note { kind: Default::default(), - url: id.clone().to_string(), id, sensitive: false, - published: chrono::Utc::now().to_rfc3339(), attributed_to: Url::parse(&data.local_user().await?.id).unwrap().into(), to: vec![public()], content: format!("Hello {}", creator.name),