add: implement 9 new scopes, 21 new api endpoints
This commit is contained in:
parent
c3139ef1d2
commit
8f16068a34
14 changed files with 973 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue