Add exclude_replies query parameter to /accounts/:id/statuses API method

This commit is contained in:
silverpill 2022-07-07 14:56:01 +00:00
parent 94bd5bdbb5
commit 2a22a0bedd
3 changed files with 13 additions and 1 deletions

View file

@ -199,6 +199,13 @@ paths:
summary: Posts created by the given actor.
parameters:
- $ref: '#/components/parameters/account_id'
- name: exclude_replies
in: query
description: Exclude replies from results.
required: false
schema:
type: boolean
default: true
- name: max_id
in: query
description: Return results older than this ID.

View file

@ -282,8 +282,13 @@ pub struct FollowData {
fn default_page_size() -> i64 { 20 }
fn default_exclude_replies() -> bool { true }
#[derive(Deserialize)]
pub struct StatusListQueryParams {
#[serde(default = "default_exclude_replies")]
pub exclude_replies: bool,
#[serde(default)]
pub pinned: bool,

View file

@ -430,7 +430,7 @@ async fn get_account_statuses(
db_client,
&profile.id,
maybe_current_user.as_ref().map(|user| &user.id),
false,
!query_params.exclude_replies,
true,
query_params.max_id,
query_params.limit,