constrain post to 300 characters

This commit is contained in:
Denis-Cosmin Nutiu 2025-01-01 17:00:12 +02:00
parent 2b1750cae2
commit 7dd315499b

View file

@ -122,7 +122,12 @@ impl From<NewsPost> for ATProtoRepoCreateRecord {
Some(ATprotoRepoCreateRecordEmbed::new( Some(ATprotoRepoCreateRecordEmbed::new(
post.link.unwrap().as_str(), post.link.unwrap().as_str(),
post.title.unwrap().as_str(), post.title.unwrap().as_str(),
post.summary.unwrap().as_str(), post.summary
.clone()
.unwrap()
.as_str()
.get(0..=300)
.unwrap_or(post.summary.unwrap().as_str()),
None, None,
)), )),
), ),