Skip to content

Commit

Permalink
fix: add mentions to TO on note import
Browse files Browse the repository at this point in the history
  • Loading branch information
CutestNekoAqua committed Jun 27, 2024
1 parent b29ca0c commit b1af17c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/lysand/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,32 @@ pub async fn receive_lysand_note(
kind: Default::default(),
})
}
let mut mentions = Vec::new();
for obj in tag.clone() {
mentions.push(obj.href.clone());
}
let to = match note
.visibility
.clone()
.unwrap_or(super::objects::VisibilityType::Public)
{
super::objects::VisibilityType::Public => {
vec![public(), Url::parse(&user.followers.to_string().as_str())?]
let mut vec = vec![public(), Url::parse(&user.followers.to_string().as_str())?];
vec.append(&mut mentions.clone());
vec
}
super::objects::VisibilityType::Followers => {
vec![Url::parse(&user.followers.to_string().as_str())?]
let mut vec = vec![Url::parse(&user.followers.to_string().as_str())?];
vec.append(&mut mentions.clone());
vec
}
super::objects::VisibilityType::Direct => note.mentions.unwrap_or_default(),
super::objects::VisibilityType::Direct => {
mentions.clone()
},
super::objects::VisibilityType::Unlisted => {
vec![Url::parse(&user.followers.to_string().as_str())?]
let mut vec = vec![Url::parse(&user.followers.to_string().as_str())?];
vec.append(&mut mentions.clone());
vec
}
};
let cc = match note
Expand Down

0 comments on commit b1af17c

Please sign in to comment.