From 21a3447a8437dea0a4ae794be0080eb13ddf2b6c Mon Sep 17 00:00:00 2001 From: aprilthepink Date: Mon, 17 Jun 2024 21:44:29 +0200 Subject: [PATCH] fix: Refactor lysand note handling in conversion.rs The commit refactors the lysand note handling in the `conversion.rs` file. It updates the `receive_lysand_note` function to properly handle quoting and replying to notes. This change improves the functionality and readability of the codebase. --- src/lysand/conversion.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lysand/conversion.rs b/src/lysand/conversion.rs index 8b3ef37..4242e71 100644 --- a/src/lysand/conversion.rs +++ b/src/lysand/conversion.rs @@ -172,11 +172,11 @@ pub async fn receive_lysand_note(note: Note, db_id: String) -> anyhow::Result "direct", super::objects::VisibilityType::Unlisted => "unlisted", }; - if let Some(obj) = quote { - println!("Quoting: {}", db_post_from_url(note.replies_to.unwrap()).await?.url); + if let Some(obj) = note.replies_to { + println!("Quoting: {}", db_post_from_url(obj).await?.url); } - if let Some(obj) = reply { - println!("Replying to: {}", db_post_from_url(note.quotes.unwrap()).await?.url); + if let Some(obj) = note.quotes { + println!("Replying to: {}", db_post_from_url(obj).await?.url); } let post = entities::post::ActiveModel { id: Set(note.id.to_string()),