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.
This commit is contained in:
aprilthepink 2024-06-17 21:44:29 +02:00
parent 9e148fe77f
commit 21a3447a84

View file

@ -172,11 +172,11 @@ pub async fn receive_lysand_note(note: Note, db_id: String) -> anyhow::Result<cr
super::objects::VisibilityType::Direct => "direct", super::objects::VisibilityType::Direct => "direct",
super::objects::VisibilityType::Unlisted => "unlisted", super::objects::VisibilityType::Unlisted => "unlisted",
}; };
if let Some(obj) = quote { if let Some(obj) = note.replies_to {
println!("Quoting: {}", db_post_from_url(note.replies_to.unwrap()).await?.url); println!("Quoting: {}", db_post_from_url(obj).await?.url);
} }
if let Some(obj) = reply { if let Some(obj) = note.quotes {
println!("Replying to: {}", db_post_from_url(note.quotes.unwrap()).await?.url); println!("Replying to: {}", db_post_from_url(obj).await?.url);
} }
let post = entities::post::ActiveModel { let post = entities::post::ActiveModel {
id: Set(note.id.to_string()), id: Set(note.id.to_string()),