cave: fix #tags in Post.to_feed_post()

This commit is contained in:
Astro 2023-10-16 01:05:38 +02:00
parent 60478dbf27
commit 669f9b4e52
1 changed files with 10 additions and 1 deletions

View File

@ -112,7 +112,16 @@ impl Post {
url: actor.url.unwrap_or(actor.id),
bot: actor.actor_type != "Person",
},
tags: self.tag,
tags: self.tag.into_iter().filter_map(|mut tag| {
while tag.name.chars().next() == Some('#') {
tag.name.remove(0);
}
if tag.name.len() > 0 {
Some(tag)
} else {
None
}
}).collect(),
sensitive: self.sensitive,
mentions: vec![],
language,