fix: check permissions before asking about a post

This commit is contained in:
trisua 2025-07-13 19:05:17 -04:00
parent 73d8e9ab49
commit 052ddf862f

View file

@ -427,6 +427,22 @@ impl DataManager {
}
}
// check asking_about
if let Some(id) = data.context.asking_about {
let post = self.get_post_by_id(id).await?;
let owner = self.get_user_by_id(post.owner).await?;
if post.stack != 0 {
return Err(Error::MiscError(
"Cannot ask about posts in a circle".to_string(),
));
} else if owner.settings.private_profile {
return Err(Error::MiscError(
"Cannot ask about posts from a private user".to_string(),
));
}
}
// create uploads
if drawings.len() > 2 {
return Err(Error::MiscError(