add: implement 9 new scopes, 21 new api endpoints

This commit is contained in:
trisua 2025-06-13 17:47:00 -04:00
parent c3139ef1d2
commit 8f16068a34
14 changed files with 973 additions and 35 deletions

View file

@ -136,7 +136,7 @@ impl DataManager {
/// * `id` - the ID of the post the requested posts are commenting on
/// * `batch` - the limit of posts in each page
/// * `page` - the page number
pub async fn get_post_comments(
pub async fn get_replies_by_post(
&self,
id: usize,
batch: usize,
@ -517,6 +517,30 @@ impl DataManager {
out
}
/// Filter to update posts to clean their owner for public APIs.
pub fn posts_owner_filter(&self, posts: &Vec<FullPost>) -> Vec<FullPost> {
let mut out: Vec<FullPost> = Vec::new();
for mut post in posts.clone() {
post.1.clean();
// reposting
if let Some((ref mut x, _)) = post.3 {
x.clean();
}
// question
if let Some((_, ref mut x)) = post.4 {
x.clean();
}
// ...
out.push(post);
}
out
}
/// Get all posts from the given user (from most recent).
///
/// # Arguments